facebookresearch / Detic

Code release for "Detecting Twenty-thousand Classes using Image-level Supervision".
Apache License 2.0
1.85k stars 211 forks source link

ModuleNotFoundError: No module named 'centernet' #65

Open zoldaten opened 2 years ago

zoldaten commented 2 years ago

hello! i`m on armv7l (raspbian Buster, raspberry pi4) with:

torch @ file:///home/pi/torch_1.12_wheels_armv7l/torch-1.12.0a0%2Bgita760dc2-cp37-cp37m-linux_armv7l.whl
torchvision @ file:///home/pi/torch_1.12_wheels_armv7l/torchvision-0.13.0a0%2B2ec0e84-cp37-cp37m-linux_ar
detectron2 @ git+https://github.com/facebookresearch/detectron2.git@453d795eb152f7210c842674810f24769d4dd8cb

but when start example:

python3 demo.py --config-file configs/Detic_LCOCOI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.yaml --input desk.jpg --output out2.jpg --vocabulary custom --custom_vocabulary headphone,webcam,paper,coffe --confidence-threshold 0.3 --opts MODEL.WEIGHTS models/Detic_LCOCOI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.pth

got error:

Traceback (most recent call last):
  File "demo.py", line 20, in <module>
    from centernet.config import add_centernet_config
ModuleNotFoundError: No module named 'centernet'

i git cloned centernet and centernet2 and tried to installed `em with pip install -r requirements.txt but error still exists ( how to fix or avoid ?

rsomani95 commented 2 years ago

@zoldaten I had the same error. You'll need to clone this repo and put it in the folder third_party/

zoldaten commented 2 years ago

got it working ! u`re my hero!

buy the way what is the fastest example for cpu only ? i have inference time 77.26s on rasberry for 1 image oO

miao3210 commented 3 months ago

After git clone the CenterNet2 repo into the third_party folder, run

import sys
sys.path.insert(0, 'third_party/CenterNet2/')

Then we won't have bug with

import centernet