zhangzhengde0225 / CDNet

The tutorials, datasets and source codes of the crosswalk detection (zebra crossing detection) network, which is robust in real scenes and real-time in Jetson nano. cross. detect. pedestrian.
134 stars 28 forks source link

Load the pre-trained file with PyTorch. #8

Closed maximedrn closed 2 years ago

maximedrn commented 2 years ago

Hi @zhangzhengde,

I'm trying to download the trainet but I'm having a problem. Since I don't live in China, I can't download from Baidu Pan site - it requires a Chinese phone number (so mine doesn't work), I tried to use Pandownload but the file is too big and can't be downloaded with this site. Also, the Jbox site seems to be down (https://jbox.sjtu.edu.cn/l/Z0i6nQ).

Would it be possible that you provide a link to download the trainset on another platform such as Mega or Mediafire? Thank you for you project :)

zhangzhengde0225 commented 2 years ago

Thank your for your attention. The download link from Google Drive has been updated in docs/DATASETS.md. Please check it out and feel free for asking any questions.

maximedrn commented 2 years ago

Thank your for your attention. The download link from Google Drive has been updated in docs/DATASETS.md. Please check it out and feel free for asking any questions.

Thank you very much :)

maximedrn commented 2 years ago

I am facing a small problem. I would like to know how to use the pre-trained file in Python with PyTorch? I'm actually doing this:

from torch.hub import load
from os.path import abspath

# "yolov5" is the folder that contains everything from Yolov5 repository.
self.crosswalk = load(abspath('yolov5'), 'custom', path=abspath('yolov5/crosswalk.pt'), source='local')

But it doesn't work, some files are missing in the Yolov5 directory (files you use in your repository). I tried to add them but there are always errors. :/

I tried with this:

from torch.hub import load
from os.path import abspath

# "cdnet" is the folder that contains everything from your repository.
self.crosswalk = load(abspath('cdnet'), 'custom', path=abspath('cdnet/crosswalk.pt'), source='local')

But I get an error because the hubconf.py file doesn't exist. Can you explain to me how to make this work? If it is possible.

zhangzhengde0225 commented 2 years ago

We did not implement loading CDNet through torch.hub, and the inner networks of CDNet are differ from original YOLOv5. Please refer to the Quick start.