Skip to content
This repository has been archived by the owner on Aug 5, 2023. It is now read-only.

how to put custom weight? #8

Closed
pouoq34 opened this issue Nov 16, 2021 · 1 comment
Closed

how to put custom weight? #8

pouoq34 opened this issue Nov 16, 2021 · 1 comment

Comments

@pouoq34
Copy link

pouoq34 commented Nov 16, 2021

Hello kaylode!
First, Thank you for sharing your project :) It is a really helpful idea for me!

I customized labels and could get customized yolo v5 weights files(best.pt).
I have tried your code using my custom weights and video but it was failde :(

When I run code without weight value. It works (but it is not result what i expected )
like this (python run.py --input_path="./cam_04.mp4" --output_path="~" )

When I run code with weight value, It shows error :(
(python run.py --input_path="./cam_04.mp4" --output_path="~" --weight="./best.pt")

image

you mentioned 3 things in "Start inference: Define these things before run"

  • path to street annotation files in configs.cam_configs.yaml
  • path to video file
  • model's checkpoint

as I undertood,

  • path to street annotation files in configs/cam_configs.yaml
    --> i can resize street size(zone) by modifying cam_configs.yaml
  • path to video file
    --> check my video file path
  • model's checkpoint
  • -> replace "vehicle-counting/models/deepsort/deep/checkpoint/ckpt.t7"
    with "customized deepsort model result(checkpint/ckpt.t7)"

Am I right?

I'll wait for your reply. Again Thanks for the good research.

@kaylode
Copy link
Owner

kaylode commented Nov 16, 2021

Hi @pouoq34, thank you for your comment :)
For your questions:

path to street annotation files in configs/cam_configs.yaml
--> i can resize street size(zone) by modifying cam_configs.yaml

You can resize the street zone and modify it yourself, but NOT by modifying cam_configs.yaml . To accomplish this, look into the zone_path argument in that file, which have demo/sample value by default. You can specify this value to your specific folder in which contains camera polygons/zones. For the format of these polygons, see demo/sample/cam_04.json for example. To change the zone size or shape, change the value for points field in the json file.

path to video file
--> check my video file path

Your path is correct, I think

model's checkpoint
-> replace "vehicle-counting/models/deepsort/deep/checkpoint/ckpt.t7"
with "customized deepsort model result(checkpint/ckpt.t7)"

Yes, if you want to use your own deepsort checkpoint. But the default deepsort checkpoint also works well (although it was trained on human dataset, not vehicle)

I customized labels and could get customized yolo v5 weights files(best.pt).
I have tried your code using my custom weights and video but it was failde :(

For now, the trained yolov5 checkpoint is not compatible with this repo. However, I will provide a checkpoint conversion script soon. If you really want to do this yourself, I give a workaround in #6.

But the error that you faced as in the image maybe due to your timm version on your local machine. Reply from efficientdet author: link.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants