AILab-CVC / YOLO-World

[CVPR 2024] Real-Time Open-Vocabulary Object Detection
https://www.yoloworld.cc
GNU General Public License v3.0
4.4k stars 426 forks source link

How to run the demo? #16

Closed ausk closed 6 months ago

ausk commented 7 months ago

I have create the conda env, download the yolo_world_l_clip_base_dua....pth

Then when I run the command follow the steps in README.md:

python3 demo.py configs/pretrain/yolo_world_s_dual_vlpan_l2norm_2e-4_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py  yolo_world_l_clip_base_dual_vlpan_2e-3adamw_32xb16_100e_o365_goldg_train_pretrained-0e566235.pth

or

python3 demo.py configs/pretrain/yolo_world_l_dual_vlpan_l2norm_2e-4_100e_4x8gpus_obj365v1_goldg_train_lvis_val.py  yolo_world_l_clip_base_dual_vlpan_2e-3adamw_32xb16_100e_o365_goldg_train_pretrained-0e566235.pth

Error occurs:

OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like pretrained_models/clip-vit-base-patch32-projection is not the path to a directory containing a file named config.json.

So, should I download pretrained_models/clip-vit-base-patch32-projection first? then where to get it?

wondervictor commented 7 months ago

Hi @ausk, thanks for you interest in YOLO-World, you can fine the checkpoint from HuggingFace CLIP.

ausk commented 7 months ago

I get the following is the log output after running the modified code.

=> pretrained_models/clip-vit-base-patch32-projection
=> huburl: https://huggingface.co/pretrained_models/clip-vit-base-patch32-projection/resolve/main/tokenizer_config.json
=> huburl: https://huggingface.co/pretrained_models/clip-vit-base-patch32-projection/resolve/main/config.json

If run wget $huburl

HTTP request sent, awaiting response... 401 Unauthorized

Username/Password Authentication Failed.

云上下载 pretrained_models/clip-vit-base-patch32-projection 登录 huggingface。没法网页登录 huggingface 就没法注册认证,下不了。

望洋兴叹: 看到洋人的高科技玩地很High 却而没法(没渠道)用上,哎

ausk commented 7 months ago

Thank you @wondervictor anyway.

wondervictor commented 7 months ago

Hi @ausk, there is a mirror for Huggingface Mirror, maybe it helps.

SuperMaximus1984 commented 7 months ago

I'm experiencing the same problem, after authentication with huggingface_cli, I still get:

Repository Not Found for url: https://huggingface.co/pretrained_models/clip-vit-base-patch32-projection/resolve/main/tokenizer_config.json.
Please make sure you specified the correct `repo_id` and `repo_type`.
If you are trying to access a private or gated repo, make sure you are authenticated

OSError: pretrained_models/clip-vit-base-patch32-projection is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo with `use_auth_token` or log in with `huggingface-cli login` and pass
`use_auth_token=True`.
wondervictor commented 7 months ago

Hi @SuperMaximus1984, you can have a try now~

wondervictor commented 6 months ago

Thanks for your interest. If you have any questions about YOLO-World in the future, you're welcome to open a new issue.

SuperMaximus1984 commented 6 months ago

Hi @SuperMaximus1984, you can have a try now~

Now I get this after checkpoints get loaded:

03/04 12:32:52 - mmengine - INFO - Load checkpoint from yolow-v8_l_clipv2_frozen_t2iv2_bn_o365_goldg_pretrain.pth
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ d:\Python Stuff\yolo-world\demo.py:164 in <module>                                               │
│                                                                                                  │
│   161 │   runner.call_hook('before_run')                                                         │
│   162 │   runner.load_or_resume()                                                                │
│   163 │   pipeline = cfg.test_dataloader.dataset.pipeline                                        │
│ ❱ 164 │   runner.pipeline = Compose(pipeline)                                                    │
│   165 │   runner.model.eval()                                                                    │
│   166 │   demo(runner, args)                                                                     │
│   167                                                                                            │
│                                                                                                  │
│ C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\mmengine\dataset\base_dat │
│ aset.py:38 in __init__                                                                           │
│                                                                                                  │
│    35 │   │   │   # `Compose` can be built with config dict with type and                        │
│    36 │   │   │   # corresponding arguments.                                                     │
│    37 │   │   │   if isinstance(transform, dict):                                                │
│ ❱  38 │   │   │   │   transform = TRANSFORMS.build(transform)                                    │
│    39 │   │   │   │   if not callable(transform):                                                │
│    40 │   │   │   │   │   raise TypeError(f'transform should be a callable object, '             │
│    41 │   │   │   │   │   │   │   │   │   f'but got {type(transform)}')                          │
│                                                                                                  │
│ C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\mmengine\registry\registr │
│ y.py:570 in build                                                                                │
│                                                                                                  │
│   567 │   │   │   >>> cfg = dict(type='ResNet', depth=50)                                        │
│   568 │   │   │   >>> model = MODELS.build(cfg)                                                  │
│   569 │   │   """                                                                                │
│ ❱ 570 │   │   return self.build_func(cfg, *args, **kwargs, registry=self)                        │
│   571 │                                                                                          │
│   572 │   def _add_child(self, registry: 'Registry') -> None:                                    │
│   573 │   │   """Add a child for a registry.                                                     │
│                                                                                                  │
│ C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\mmengine\registry\build_f │
│ unctions.py:100 in build_from_cfg                                                                │
│                                                                                                  │
│    97 │   │   if isinstance(obj_type, str):                                                      │
│    98 │   │   │   obj_cls = registry.get(obj_type)                                               │
│    99 │   │   │   if obj_cls is None:                                                            │
│ ❱ 100 │   │   │   │   raise KeyError(                                                            │
│   101 │   │   │   │   │   f'{obj_type} is not in the {registry.scope}::{registry.name} registr   │
│   102 │   │   │   │   │   f'Please check whether the value of `{obj_type}` is '                  │
│   103 │   │   │   │   │   'correct or it was registered as expected. More details '              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 'LoadTextFixed is not in the mmyolo::transform registry. Please check whether the value of `LoadTextFixed` is correct or it was registered
as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#import-the-custom-module'

Trying to run Gradio demo with: python demo.py configs/pretrain/yolo_world_v2_l_vlpan_bn_2e-3_100e_4x8gpus_obj365v1_goldg_train_1280ft_lvis_minival.py yolow-v8_l_clipv2_frozen_t2iv2_bn_o365_goldg_pretrain.pth