kaylode / vehicle-counting

Vehicle counting using Pytorch
MIT License
95 stars 32 forks source link

Pass video without the json file #20

Open BatoolHamawi opened 2 years ago

BatoolHamawi commented 2 years ago

@kaylode thanks for great work ! How to run the code with new video that don't have the json file that include annotations as in demo folder, I have multiple videos and I want to use the pretrained model on them

!python run.py --input_path='/content/main/demo/sample/cam_04.mp4' \
              --output_path="/content/results" \
              --weight="/content/gdrive/MyDrive/best.pt"

as we can see we should have a json file in the same folder (demo/sample) with the video and it must have the same name, what if we want to pass a new video that don't have a json of annotations ?

AhmedHefnawy commented 2 years ago

is it run successfully !! i can't run it successfully it's give me an error :

Traceback (most recent call last): File "C:\AhmedHefnawy\buy\altr\vehicle-counting-master\vehicle-counting-master\run.py", line 48, in main(args, config) File "C:\AhmedHefnawy\buy\altr\vehicle-counting-master\vehicle-counting-master\run.py", line 30, in main pipeline.run() File "C:\AhmedHefnawy\buy\altr\vehicle-counting-master\vehicle-counting-master\modules__init.py", line 31, in run videoloader = VideoLoader(self.config, video_path) File "C:\AhmedHefnawy\buy\altr\vehicle-counting-master\vehicle-counting-master\modules\datasets.py", line 89, in init dataset = VideoSet(config, video_path) File "C:\AhmedHefnawy\buy\altr\vehicle-counting-master\vehicle-counting-master\modules\datasets.py", line 24, in init__ self.initialize_stream() File "C:\AhmedHefnawy\buy\altr\vehicle-counting-master\vehicle-counting-master\modules\datasets.py", line 46, in initialize_stream assert 0, f"Cannot read video {os.path.basename(self.input_path)}" AssertionError: Cannot read video cam_04.mp4'

Can you help ?!!