zcablii / SARDet_100K

Offical implementation of MSFA and release of SARDet_100K dataset for Large-Scale Synthetic Aperture Radar (SAR) Object Detection
Other
322 stars 25 forks source link

Inferencing on SAR images #15

Closed shubh-acad closed 4 months ago

shubh-acad commented 4 months ago

I was going through the repository and found it quite great. But I am unable to figure out how to run inference on other SAR test images using MSFA. There is no example given as well. Can you please guide how to run an inference on a single/batch of image(s) using MSFA and also any demo script to run training on images?

zcablii commented 4 months ago

As in #5 , This repo is based on MMDetection, please refer to user_guides for detailed instructions.

shubh-acad commented 4 months ago

I tried using that but I am getting errors, I ran the test.py file and got this error,please guide :

I ran the following command : python test.py --work-dir output/ --show-dir output/ convnext_t_sar_wavelet\20231224_171637\vis_data\config.py epoch_100.pth

04/25 14:00:53 - mmengine - INFO - Because batch augmentations are enabled, the data preprocessor automatically enables theto_onehotoption to generate one-hot format labels. Traceback (most recent call last): File "test.py", line 152, in <module> main() File "test.py", line 134, in main runner = Runner.from_cfg(cfg) File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\runner\runner.py", line 445, in from_cfg runner = cls( File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\runner\runner.py", line 412, in __init__ self.model = self.build_model(model) File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\runner\runner.py", line 819, in build_model model = MODELS.build(model) File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\registry.py", line 570, in build return self.build_func(cfg, *args, **kwargs, registry=self) File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 232, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 121, in build_from_cfg obj = obj_cls(**args) # type: ignore File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmpretrain\models\classifiers\image.py", line 71, in __init__ backbone = MODELS.build(backbone) File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\registry.py", line 570, in build return self.build_func(cfg, *args, **kwargs, registry=self) File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 232, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 100, in build_from_cfg raise KeyError( KeyError: 'Self_features_model is not in the mmpretrain::model registry. Please check whether the value ofSelf_features_modelis 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'

shubh-acad commented 4 months ago

Even running on mmdetection using image_demo.py (which is available at mmdetection repository), i get the following error :

python image_demo.py abc.JPG convnext_t_sar_wavelet/convnext_t_sar_wavelet.py --weights epoch_100.pth --device cpu

I get the following error :

Loads checkpoint by local backend from path: epoch_100.pth
Traceback (most recent call last):
  File "image_demo.py", line 192, in <module>
    main()
  File "image_demo.py", line 179, in main
    inferencer = DetInferencer(**init_args)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmdet\apis\det_inferencer.py", line 98, in __init__
    super().__init__(
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\infer\infer.py", line 180, in __init__
    self.model = self._init_model(cfg, weights, device)  # type: ignore
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\infer\infer.py", line 483, in _init_model
    model = MODELS.build(cfg.model)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 232, in build_model_from_cfg
    return build_from_cfg(cfg, registry, default_args)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 100, in build_from_cfg
    raise KeyError(
KeyError: 'ImageClassifier is not in the mmdet::model registry. Please check whether the value of `ImageClassifier` 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'
zcablii commented 4 months ago

you are using pretrained backbone for detection. Also, please use config files provided in the github repo, not the configs in the ckpt folders.

shubh-acad commented 4 months ago

@zcablii While inferencing,I have provided the same config file ,that came with the weights downloaded from the link provided in the repository page.

shubh-acad commented 4 months ago

@zcablii I ran the model with the following command with config from local_configs and the image_demo.py is same as given at mmdetection_image_demo:

python image_demo.py abc.JPG "D:\SARDet_100K-main\MSFA\local_configs\SARDet\ot
her_backbones\fg_frcnn_dota_pretrain_sar_convnext_b_wavelet.py" --weights epoch_100.pth --device cpu

Got the following error :

Loads checkpoint by local backend from path: epoch_100.pth
Traceback (most recent call last):
  File "image_demo.py", line 192, in <module>
    main()
  File "image_demo.py", line 179, in main
    inferencer = DetInferencer(**init_args)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmdet\apis\det_inferencer.py", line 98, in __init__
    super().__init__(
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\infer\infer.py", line 180, in __init__
    self.model = self._init_model(cfg, weights, device)  # type: ignore
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\infer\infer.py", line 483, in _init_model
    model = MODELS.build(cfg.model)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 232, in build_model_from_cfg
    return build_from_cfg(cfg, registry, default_args)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 121, in build_from_cfg
    obj = obj_cls(**args)  # type: ignore
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmdet\models\detectors\faster_rcnn.py", line 20, in __init__
    super().__init__(
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmdet\models\detectors\two_stage.py", line 34, in __init__
    self.backbone = MODELS.build(backbone)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 232, in build_model_from_cfg
    return build_from_cfg(cfg, registry, default_args)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 100, in build_from_cfg
    raise KeyError(
KeyError: 'MSFA is not in the mmdet::model registry. Please check whether the value of `MSFA` 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'

I am new to mmdetection and MSFA.Please guide how can I do inferencing with pretrained weights as I downloaded the weights and applied inferencing as it is using the example from mmdetection ?

zcablii commented 4 months ago

I am sorry, I just noticed that I forgot to upload MSFA model for convnext_b+frcnn. The shared ckpts are updated just now.

Firstly, epoch_100.pth is the pretrianed backbone, not the whole detection network, you may want to load fg_frcnn_dota_pretrain_sar_convnext_b_wavelet\best_coco_bbox_mAP_epoch_12.pth for fg_frcnn_dota_pretrain_sar_convnext_b_wavelet.py. I.e. python test.py local_configs\SARDet\other_backbones\fg_frcnn_dota_pretrain_sar_convnext_b_wavelet.py fg_frcnn_dota_pretrain_sar_convnext_b_waveletbest_coco_bbox_mAP_epoch_12.pth ...

Secondly, if you want to use image_demo.py under mmdet repo, please add import msfa in the image_demo.py

shubh-acad commented 4 months ago

Thanks a lot.Please let me test.

shubh-acad commented 4 months ago

@zcablii I checked in the onedrive link shared by you...the ckpts folder does not have fg_frcnn_dota_pretrain_sar_convnext_b_wavelet model.Can you please guide ?

zcablii commented 4 months ago

Please check now

shubh-acad commented 4 months ago

@zcablii Ok Thanks. I imported msfa by import msfa in image_demo.py and then I tried with different config and got this error :

python image_demo.py abc.JPG "D:\SARDet_100K-main\MSFA\local_configs\SARDet\other_backbones\pretrain_frcnn_dota_convnext_b_sar_wavelet.py" --weights best_coco_bbox_mAP_epoch_12.pth --device gpu --ou
t-dir outputs/
Loads checkpoint by local backend from path: best_coco_bbox_mAP_epoch_12.pth
Traceback (most recent call last):
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\config\config.py", line 106, in __getattr__
    value = super().__getattr__(name)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\addict\addict.py", line 67, in __getattr__
    return self.__getitem__(item)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\config\config.py", line 135, in __getitem__
    return self.build_lazy(super().__getitem__(key))
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\config\config.py", line 102, in __missing__
    raise KeyError(name)
KeyError: 'test_dataloader'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "image_demo.py", line 192, in <module>
    main()
  File "image_demo.py", line 179, in main
    inferencer = DetInferencer(**init_args)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmdet\apis\det_inferencer.py", line 98, in __init__
    super().__init__(
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\infer\infer.py", line 180, in __init__
    self.model = self._init_model(cfg, weights, device)  # type: ignore
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\infer\infer.py", line 485, in _init_model
    self._load_weights_to_model(model, checkpoint, cfg)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmdet\apis\det_inferencer.py", line 144, in _load_weights_to_model
    test_dataset_cfg = copy.deepcopy(cfg.test_dataloader.dataset)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\config\config.py", line 1489, in __getattr__
    return getattr(self._cfg_dict, name)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\config\config.py", line 110, in __getattr__
    raise AttributeError(f"'{self.__class__.__name__}' object has no "
AttributeError: 'ConfigDict' object has no attribute 'test_dataloader'
zcablii commented 4 months ago

not sure about this error. You can try to comment out test_evaluator and test_dataloader under MSFA/configs/base/datasets/SARDet_100k.py,and add test_cfg=None at the end.

shubh-acad commented 4 months ago

not sure about this error. You can try to comment out test_evaluator and test_dataloader under MSFA/configs/base/datasets/SARDet_100k.py,and add test_cfg=None at the end.

I am still getting the same error,despite making those changes. Further, when I run the config file fg_frcnn_dota_pretrain_sar_convnext_b_wavelet

python image_demo.py abc.JPG "D:\SARDet_100K-main\MSFA\local_configs\SARDet\other_backbones\fg_frcnn_dota_pretrain_sar_convnext_b_wavelet.py" --weights fg_frcnn/best_coco_bbox_mAP_epoch_12.pth --device cuda --out-dir outputs/

I run into another issue :

Loads checkpoint by local backend from path: fg_frcnn/best_coco_bbox_mAP_epoch_12.pth
04/25 18:23:18 - mmengine - WARNING - Failed to search registry with scope "mmdet" in the "function" registry tree. As a workaround, the current "function" registry in "mmengine" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmdet" is a correct scope, or whether the registry is initialized.
C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\visualization\visualizer.py:196: UserWarning: Failed to add <class 'mmengine.visualization.vis_backend.LocalVisBackend'>, please provide the `save_dir` argument.
  warnings.warn(f'Failed to add {vis_backend.__class__}, '
Traceback (most recent call last):
  File "image_demo.py", line 192, in <module>
    main()
  File "image_demo.py", line 184, in main
    inferencer(**call_args)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmdet\apis\det_inferencer.py", line 359, in __call__
    ) = self._dispatch_kwargs(**kwargs)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\infer\infer.py", line 611, in _dispatch_kwargs
    raise ValueError(
ValueError: unknown argument {'tokens_positive'} for `preprocess`, `forward`, `visualize` and `postprocess`

Please help.

zcablii commented 4 months ago

never came across such issue lol. What about using python tools/test.py ... ?

shubh-acad commented 4 months ago

Running into a bag of issues :

1) If I use, the new config file you shared alongwith weights ,I used the following command and run into the following issue : python test.py --show-dir output/ fg_frcnn_dota_pretrain_sar_convnext_b_wavelet.py fg_frcnn/best_coco_bbox_mAP_epoch_12.pth

Traceback (most recent call last):
  File "test.py", line 150, in <module>
    main()
  File "test.py", line 132, in main
    runner = Runner.from_cfg(cfg)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\runner\runner.py", line 445, in from_cfg
    runner = cls(
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\runner\runner.py", line 412, in __init__
    self.model = self.build_model(model)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\runner\runner.py", line 819, in build_model
    model = MODELS.build(model)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 232, in build_model_from_cfg
    return build_from_cfg(cfg, registry, default_args)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 121, in build_from_cfg
    obj = obj_cls(**args)  # type: ignore
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmdet\models\detectors\faster_rcnn.py", line 20, in __init__
    super().__init__(
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmdet\models\detectors\two_stage.py", line 34, in __init__
    self.backbone = MODELS.build(backbone)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 232, in build_model_from_cfg
    return build_from_cfg(cfg, registry, default_args)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 100, in build_from_cfg
    raise KeyError(
KeyError: 'Self_features_model is not in the mmdet::model registry. Please check whether the value of `Self_features_model` 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'

2.) If I use the config given in repo's local_configs,backbones and run test.py :

python test.py --show-dir output/ "D:\SARDet_100K-main\MSFA\local_configs\SARDet\other_backbones\fg_frcnn_dota_pretrain_sar_convnext_b_wavelet.py" fg_frcnn/best_coco_bbox_mAP_epoch_12.pth

loading annotations into memory...
Traceback (most recent call last):
  File "test.py", line 150, in <module>
    main()
  File "test.py", line 146, in main
    runner.test()
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\runner\runner.py", line 1784, in test
    self._test_loop = self.build_test_loop(self._test_loop)  # type: ignore
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\runner\runner.py", line 1579, in build_test_loop
    loop = LOOPS.build(
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 121, in build_from_cfg
    obj = obj_cls(**args)  # type: ignore
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\runner\loops.py", line 410, in __init__
    super().__init__(runner, dataloader)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\runner\base_loop.py", line 26, in __init__
    self.dataloader = runner.build_dataloader(
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\runner\runner.py", line 1353, in build_dataloader
    dataset = DATASETS.build(dataset_cfg)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\registry\build_functions.py", line 121, in build_from_cfg
    obj = obj_cls(**args)  # type: ignore
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmdet\datasets\base_det_dataset.py", line 44, in __init__
    super().__init__(*args, **kwargs)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\dataset\base_dataset.py", line 245, in __init__
    self.full_init()
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmdet\datasets\base_det_dataset.py", line 69, in full_init
    self.data_list = self.load_data_list()
  File "d:\sardet_100k-main\msfa\msfa\datasets\SAR_Det.py", line 35, in load_data_list
    self.coco = self.COCOAPI(local_path)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmdet\datasets\api_wrappers\coco_api.py", line 25, in __init__
    super().__init__(annotation_file=annotation_file)
  File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\pycocotools\coco.py", line 81, in __init__
    with open(annotation_file, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/share/remote_sense/SARDet_100K/Annotations/test.json'

Can you please guide by running an inference on one image with any of the backbones ? I have tried reinstalling the whole environment again but nothing seesm to give results.

zcablii commented 4 months ago
  1. As I said, please use config files provided in the github repo, not the configs in the ckpt folders.
  2. As mentioned in #2 , test set is not provided so far. You can modify the configs to replace test set by val set instead. (in MSFA/configs/_base_/datasets/SARDet_100k.py)
zcablii commented 4 months ago

image_demo.py works fine with me, I'm not sure why such an issue arises for you. In case of any misoperation conducted by you, I just uploaded image_demo.py under SARDet_100K/MSFA. With the MSFA environment, you should simply run python demo/image_demo.py ABC.jpg local_configs/SARDet/r50_dota_pretrain/fg_frcnn_dota_pretrain_sar_wavelet_r50.py --weights work_dirs/fg_frcnn_dota_pretrain_sar_wavelet_r50/best_coco_bbox_mAP_epoch_11.pth --out-dir ./ The prediction result of this single image will be saved at ./preds/ABC.json.

shubh-acad commented 4 months ago

@zcablii As per you, ran the following command post downloading the weights from fg_frcnn_dota_pretrain_sar_wavelet_r50 at onedrive i.e. best_coco_bbox_mAP_epoch_12.pth and ran:

python image_demo.py abc.jpg "D:\SARDet_100K-main\MSFA\local_configs\SARDet\r50_dota_pretrain\fg_frcnn_dota_pretrain_sar_wavelet_r50.py" --weights best_coco_bbox_mAP_epoch_12.pth --out-dir ./

Ran into this :

Loads checkpoint by local backend from path: best_coco_bbox_mAP_epoch_12.pth 04/26 12:23:56 - mmengine - WARNING - Failed to search registry with scope "mmdet" in the "function" registry tree. As a workaround, the current "function" registry in "mmengine" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmdet" is a correct scope, or whether the registry is initialized. C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\visualization\visualizer.py:196: UserWarning: Failed to add <class 'mmengine.visualization.vis_backend.LocalVisBackend'>, please provide thesave_dirargument. warnings.warn(f'Failed to add {vis_backend.__class__}, ' Traceback (most recent call last): File "image_demo.py", line 192, in <module> main() File "image_demo.py", line 184, in main inferencer(**call_args) File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmdet\apis\det_inferencer.py", line 359, in __call__ ) = self._dispatch_kwargs(**kwargs) File "C:\Users\shubh\anaconda3\envs\MSFA\lib\site-packages\mmengine\infer\infer.py", line 611, in _dispatch_kwargs raise ValueError( ValueError: unknown argument {'tokens_positive'} forpreprocess,forward,visualizeandpostprocess``

I again reinstalled the environment and got this.

shubh-acad commented 4 months ago

@zcablii Meanwhile,my environment looks like this :

# packages in environment at C:\Users\shubh\anaconda3\envs\MSFA:
#
# Name                    Version                   Build  Channel
addict                    2.4.0                    pypi_0    pypi
aliyun-python-sdk-core    2.15.1                   pypi_0    pypi
aliyun-python-sdk-kms     2.16.2                   pypi_0    pypi
appdirs                   1.4.4                    pypi_0    pypi
blas                      2.122                       mkl    conda-forge
blas-devel                3.9.0              22_win64_mkl    conda-forge
brotli-python             1.1.0            py38hd3f51b4_1    conda-forge
bzip2                     1.0.8                hcfcfb64_5    conda-forge
ca-certificates           2024.2.2             h56e8100_0    conda-forge
certifi                   2024.2.2           pyhd8ed1ab_0    conda-forge
cffi                      1.16.0                   pypi_0    pypi
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
click                     8.1.7                    pypi_0    pypi
colorama                  0.4.6                    pypi_0    pypi
configparser              7.0.0                    pypi_0    pypi
contourpy                 1.1.1                    pypi_0    pypi
crcmod                    1.7                      pypi_0    pypi
cryptography              42.0.5                   pypi_0    pypi
cuda-cccl                 12.4.127                      0    nvidia
cuda-cudart               11.8.89                       0    nvidia
cuda-cudart-dev           11.8.89                       0    nvidia
cuda-cupti                11.8.87                       0    nvidia
cuda-libraries            11.8.0                        0    nvidia
cuda-libraries-dev        11.8.0                        0    nvidia
cuda-nvrtc                11.8.89                       0    nvidia
cuda-nvrtc-dev            11.8.89                       0    nvidia
cuda-nvtx                 11.8.86                       0    nvidia
cuda-profiler-api         12.4.127                      0    nvidia
cuda-runtime              11.8.0                        0    nvidia
cycler                    0.12.1                   pypi_0    pypi
filelock                  3.13.4             pyhd8ed1ab_0    conda-forge
fonttools                 4.51.0                   pypi_0    pypi
freetype                  2.12.1               hdaf720e_2    conda-forge
idna                      3.7                pyhd8ed1ab_0    conda-forge
importlib-metadata        7.1.0                    pypi_0    pypi
importlib-resources       6.4.0                    pypi_0    pypi
intel-openmp              2024.1.0           h57928b3_965    conda-forge
jinja2                    3.1.3              pyhd8ed1ab_0    conda-forge
jmespath                  0.10.0                   pypi_0    pypi
jpeg                      9e                   hcfcfb64_3    conda-forge
kiwisolver                1.4.5                    pypi_0    pypi
kymatio                   0.3.0                    pypi_0    pypi
lcms2                     2.15                 ha5c8aab_0    conda-forge
lerc                      4.0.0                h63175ca_0    conda-forge
libblas                   3.9.0              22_win64_mkl    conda-forge
libcblas                  3.9.0              22_win64_mkl    conda-forge
libcublas                 11.11.3.6                     0    nvidia
libcublas-dev             11.11.3.6                     0    nvidia
libcufft                  10.9.0.58                     0    nvidia
libcufft-dev              10.9.0.58                     0    nvidia
libcurand                 10.3.5.147                    0    nvidia
libcurand-dev             10.3.5.147                    0    nvidia
libcusolver               11.4.1.48                     0    nvidia
libcusolver-dev           11.4.1.48                     0    nvidia
libcusparse               11.7.5.86                     0    nvidia
libcusparse-dev           11.7.5.86                     0    nvidia
libdeflate                1.17                 hcfcfb64_0    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libhwloc                  2.10.0          default_h2fffb23_1000    conda-forge
libiconv                  1.17                 hcfcfb64_2    conda-forge
liblapack                 3.9.0              22_win64_mkl    conda-forge
liblapacke                3.9.0              22_win64_mkl    conda-forge
libnpp                    11.8.0.86                     0    nvidia
libnpp-dev                11.8.0.86                     0    nvidia
libnvjpeg                 11.9.0.86                     0    nvidia
libnvjpeg-dev             11.9.0.86                     0    nvidia
libpng                    1.6.43               h19919ed_0    conda-forge
libsqlite                 3.45.3               hcfcfb64_0    conda-forge
libtiff                   4.5.0                hf8721a0_2    conda-forge
libuv                     1.48.0               hcfcfb64_0    conda-forge
libwebp-base              1.4.0                hcfcfb64_0    conda-forge
libxcb                    1.13              hcd874cb_1004    conda-forge
libxml2                   2.12.6               hc3477c8_2    conda-forge
libzlib                   1.2.13               hcfcfb64_5    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6    conda-forge
m2w64-gcc-libs            5.3.0                         7    conda-forge
m2w64-gcc-libs-core       5.3.0                         7    conda-forge
m2w64-gmp                 6.1.0                         2    conda-forge
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    conda-forge
markdown                  3.6                      pypi_0    pypi
markdown-it-py            3.0.0                    pypi_0    pypi
markupsafe                2.1.5            py38h91455d4_0    conda-forge
matplotlib                3.7.5                    pypi_0    pypi
mdurl                     0.1.2                    pypi_0    pypi
mkl                       2024.1.0           h66d3029_692    conda-forge
mkl-devel                 2024.1.0           h57928b3_692    conda-forge
mkl-include               2024.1.0           h66d3029_692    conda-forge
mmcv                      2.0.1                    pypi_0    pypi
mmdet                     3.1.0                    pypi_0    pypi
mmengine                  0.8.4                    pypi_0    pypi
model-index               0.1.11                   pypi_0    pypi
mpmath                    1.3.0              pyhd8ed1ab_0    conda-forge
msfa                      3.1.0                     dev_0    <develop>
msys2-conda-epoch         20160418                      1    conda-forge
networkx                  3.1                pyhd8ed1ab_0    conda-forge
numpy                     1.24.4           py38h1d91fd2_0    conda-forge
opencv-python             4.9.0.80                 pypi_0    pypi
opendatalab               0.0.10                   pypi_0    pypi
openjpeg                  2.5.0                ha2aaf27_2    conda-forge
openmim                   0.3.9                    pypi_0    pypi
openssl                   3.2.1                hcfcfb64_1    conda-forge
openxlab                  0.0.38                   pypi_0    pypi
ordered-set               4.1.0                    pypi_0    pypi
oss2                      2.17.0                   pypi_0    pypi
packaging                 24.0                     pypi_0    pypi
pandas                    2.0.3                    pypi_0    pypi
pillow                    9.4.0            py38h087119c_1    conda-forge
pip                       24.0               pyhd8ed1ab_0    conda-forge
platformdirs              4.2.1                    pypi_0    pypi
pthread-stubs             0.4               hcd874cb_1001    conda-forge
pthreads-win32            2.9.1                hfa6e2cd_3    conda-forge
pycocotools               2.0.7                    pypi_0    pypi
pycparser                 2.22                     pypi_0    pypi
pycryptodome              3.20.0                   pypi_0    pypi
pygments                  2.17.2                   pypi_0    pypi
pyparsing                 3.1.2                    pypi_0    pypi
pysocks                   1.7.1              pyh0701188_6    conda-forge
python                    3.8.19          h4de0772_0_cpython    conda-forge
python-dateutil           2.9.0.post0              pypi_0    pypi
python_abi                3.8                      4_cp38    conda-forge
pytorch                   2.0.1           py3.8_cuda11.8_cudnn8_0    pytorch
pytorch-cuda              11.8                 h24eeafa_5    pytorch
pytorch-mutex             1.0                        cuda    pytorch
pytz                      2023.4                   pypi_0    pypi
pywin32                   306                      pypi_0    pypi
pyyaml                    6.0.1                    pypi_0    pypi
regex                     2024.4.16                pypi_0    pypi
requests                  2.28.2                   pypi_0    pypi
rich                      13.4.2                   pypi_0    pypi
scipy                     1.10.1                   pypi_0    pypi
setuptools                60.2.0                   pypi_0    pypi
shapely                   2.0.4                    pypi_0    pypi
six                       1.16.0                   pypi_0    pypi
sympy                     1.12               pyh04b8f61_3    conda-forge
tabulate                  0.9.0                    pypi_0    pypi
tbb                       2021.12.0            h91493d7_0    conda-forge
termcolor                 2.4.0                    pypi_0    pypi
terminaltables            3.1.10                   pypi_0    pypi
timm                      0.4.12                   pypi_0    pypi
tk                        8.6.13               h5226925_1    conda-forge
tomli                     2.0.1                    pypi_0    pypi
torchaudio                2.0.2                    pypi_0    pypi
torchhaarfeatures         0.0.2                    pypi_0    pypi
torchvision               0.15.2                   pypi_0    pypi
tqdm                      4.65.2                   pypi_0    pypi
typing_extensions         4.11.0             pyha770c72_0    conda-forge
tzdata                    2024.1                   pypi_0    pypi
ucrt                      10.0.22621.0         h57928b3_0    conda-forge
urllib3                   1.26.18                  pypi_0    pypi
vc                        14.3                hcf57466_18    conda-forge
vc14_runtime              14.38.33130         h82b7239_18    conda-forge
vs2015_runtime            14.38.33130         hcb4865c_18    conda-forge
wheel                     0.43.0             pyhd8ed1ab_1    conda-forge
win_inet_pton             1.1.0              pyhd8ed1ab_6    conda-forge
xorg-libxau               1.0.11               hcd874cb_0    conda-forge
xorg-libxdmcp             1.1.3                hcd874cb_0    conda-forge
xz                        5.2.6                h8d14728_0    conda-forge
yapf                      0.40.1                   pypi_0    pypi
zipp                      3.18.1                   pypi_0    pypi
zstd                      1.5.5                h12be248_0    conda-forge
zcablii commented 4 months ago

It's weird, on my linux device, the code just works fine.

shubh-acad commented 4 months ago

@zcablii Can you reinstall a fresh environment and then try ? It does not work. Does it work with the same set and version of packages for you ?

zcablii commented 4 months ago

It works for me and other users. I am not sure if it is caused by the operation system. I am afraid this is some specific issue you are facing to, you may need to debug by yourself.

shubh-acad commented 4 months ago

I commented the code for tokens-positive in image_demo.py and it ran successfully ...How can I save the annotated image with the predictions ?

zcablii commented 4 months ago

you can add --show argument after test.py. For more instructions, please refer to mmdet.

shubh-acad commented 4 months ago

@zcablii Yes.I did that and it perfectly works.Can you please explain the importance of tokens_positive ?

zcablii commented 4 months ago

It's not important at all. Normally it is ignored.

shubh-acad commented 4 months ago

@zcablii Ok. Thanks a lot. I see a lot of detectors listed in the folders, but the weights of only specific are only given. I wanted to try on different detectors, for example fg_frcnn_dota_pretrain_sar_hog_haar_wavelet_r50 given under r50_dota_pretrain of local_configs but the weights are not available in the one drive link.Do you plan to share the weights of other detectors as well ?

zcablii commented 4 months ago

Such models are mostly for ablation study, which are not significant models for final release. However, we still provided code and configs for easy reproduction. Unfortunately, some of these model weights are not kept on our devices. If you want any of such weights, u can contact me but no guarantee.

shubh-acad commented 4 months ago

@zcablii Thanks a lot for helping.This repository is supercool to deal with.Kudos to your work.I was able to learn a lot while debugging this. I was able to run the model with your help. As I was experimenting with various backbones it was really great. I just stumbled upon hrsid_frcnn_van_sar_wavelet_bs32_3 and saw that it's config file is not there in the repo.Can you please update that in the repo,the weights are available in onedrive but none of the config files are working ?

zcablii commented 4 months ago

That is hrsid_frcnn_van_b_sar_wavelet.py