ZPDu / DAI-Net

[CVPR 2024] Boosting Object Detection with Zero-Shot Day-Night Domain Adaptation
https://zpdu.github.io/DAINet_page/
107 stars 7 forks source link

Some questions about your code. #9

Closed wangSir0202 closed 5 months ago

wangSir0202 commented 6 months ago

Dear author,

I just read your paper and started to study your code. I have two questions about the use of the code:

First, in the test.py file, I only see codes related to face detection. How can we modify these codes to apply to general datasets (COCO or VOC datasets) or our own datasets?

Second, When is your training code expected to be updated on GitHub?

Thank you very much for your help.

ZPDu commented 6 months ago

Hi, thanks for your interest.

1) Please see the part of ExDark evaluation. We build our pipeline using MAET as the codebase for general datasets like COCO. MAET is established using MMDet, which is compatible with many detectors and datasets.

2) I will update the training code before the conference. Please stay tuned. Thank you.

wangSir0202 commented 6 months ago

Thanks for your answer! There is an another question happened when I try to run 'test.py' file. I have filled in the model weight with 'ExDark.pth'. And change the imglist( def loadimages(): imglist = glob.glob('./ExDark') # Set the dir of your test data return imglist ). There is a question while I run test.py file: ''' (base) sheng@sheng-System-Product-Name:~/wxl/DAI-Net$ python test.py build network /home/sheng/wxl/DAI-Net/layers/modules/l2norm.py:26: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant. init.constant(self.weight,self.gamma) Traceback (most recent call last): File "test.py", line 233, in net = load_models() File "test.py", line 207, in load_models net.load_state_dict(torch.load('./ExDark.pth')) # Set the dir of your model weight File "/home/sheng/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1407, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for DSFD: Missing key(s) in state_dict: "vgg.0.weight", "vgg.0.bias", "vgg.2.weight", "vgg.2.bias", "vgg.5.weight", "vgg.5.bias", "vgg.7.weight", "vgg.7.bias", "vgg.10.weight", "vgg.10.bias", "vgg.12.weight", "vgg.12.bias", "vgg.14.weight", "vgg.14.bias", "vgg.17.weight", "vgg.17.bias", "vgg.19.weight", "vgg.19.bias", "vgg.21.weight", "vgg.21.bias", "vgg.24.weight", "vgg.24.bias", "vgg.26.weight", "vgg.26.bias", "vgg.28.weight", "vgg.28.bias", "vgg.31.weight", "vgg.31.bias", "vgg.33.weight", "vgg.33.bias", "L2Normof1.weight", "L2Normof2.weight", "L2Normof3.weight", "extras.0.weight", "extras.0.bias", "extras.1.weight", "extras.1.bias", "extras.2.weight", "extras.2.bias", "extras.3.weight", "extras.3.bias", "fpn_topdown.0.weight", "fpn_topdown.0.bias", "fpn_topdown.1.weight", "fpn_topdown.1.bias", "fpn_topdown.2.weight", "fpn_topdown.2.bias", "fpn_topdown.3.weight", "fpn_topdown.3.bias", "fpn_topdown.4.weight", "fpn_topdown.4.bias", "fpn_topdown.5.weight", "fpn_topdown.5.bias", "fpn_latlayer.0.weight", "fpn_latlayer.0.bias", "fpn_latlayer.1.weight", "fpn_latlayer.1.bias", "fpn_latlayer.2.weight", "fpn_latlayer.2.bias", "fpn_latlayer.3.weight", "fpn_latlayer.3.bias", "fpn_latlayer.4.weight", "fpn_latlayer.4.bias", "fpn_fem.0.branch1.weight", "fpn_fem.0.branch1.bias", "fpn_fem.0.branch2.0.weight", "fpn_fem.0.branch2.0.bias", "fpn_fem.0.branch2.2.weight", "fpn_fem.0.branch2.2.bias", "fpn_fem.0.branch3.0.weight", "fpn_fem.0.branch3.0.bias", "fpn_fem.0.branch3.2.weight", "fpn_fem.0.branch3.2.bias", "fpn_fem.0.branch3.4.weight", "fpn_fem.0.branch3.4.bias", "fpn_fem.1.branch1.weight", "fpn_fem.1.branch1.bias", "fpn_fem.1.branch2.0.weight", "fpn_fem.1.branch2.0.bias", "fpn_fem.1.branch2.2.weight", "fpn_fem.1.branch2.2.bias", "fpn_fem.1.branch3.0.weight", "fpn_fem.1.branch3.0.bias", "fpn_fem.1.branch3.2.weight", "fpn_fem.1.branch3.2.bias", "fpn_fem.1.branch3.4.weight", "fpn_fem.1.branch3.4.bias", "fpn_fem.2.branch1.weight", "fpn_fem.2.branch1.bias", "fpn_fem.2.branch2.0.weight", "fpn_fem.2.branch2.0.bias", "fpn_fem.2.branch2.2.weight", "fpn_fem.2.branch2.2.bias", "fpn_fem.2.branch3.0.weight", "fpn_fem.2.branch3.0.bias", "fpn_fem.2.branch3.2.weight", "fpn_fem.2.branch3.2.bias", "fpn_fem.2.branch3.4.weight", "fpn_fem.2.branch3.4.bias", "fpn_fem.3.branch1.weight", "fpn_fem.3.branch1.bias", "fpn_fem.3.branch2.0.weight", "fpn_fem.3.branch2.0.bias", "fpn_fem.3.branch2.2.weight", "fpn_fem.3.branch2.2.bias", "fpn_fem.3.branch3.0.weight", "fpn_fem.3.branch3.0.bias", "fpn_fem.3.branch3.2.weight", "fpn_fem.3.branch3.2.bias", "fpn_fem.3.branch3.4.weight", "fpn_fem.3.branch3.4.bias", "fpn_fem.4.branch1.weight", "fpn_fem.4.branch1.bias", "fpn_fem.4.branch2.0.weight", "fpn_fem.4.branch2.0.bias", "fpn_fem.4.branch2.2.weight", "fpn_fem.4.branch2.2.bias", "fpn_fem.4.branch3.0.weight", "fpn_fem.4.branch3.0.bias", "fpn_fem.4.branch3.2.weight", "fpn_fem.4.branch3.2.bias", "fpn_fem.4.branch3.4.weight", "fpn_fem.4.branch3.4.bias", "fpn_fem.5.branch1.weight", "fpn_fem.5.branch1.bias", "fpn_fem.5.branch2.0.weight", "fpn_fem.5.branch2.0.bias", "fpn_fem.5.branch2.2.weight", "fpn_fem.5.branch2.2.bias", "fpn_fem.5.branch3.0.weight", "fpn_fem.5.branch3.0.bias", "fpn_fem.5.branch3.2.weight", "fpn_fem.5.branch3.2.bias", "fpn_fem.5.branch3.4.weight", "fpn_fem.5.branch3.4.bias", "L2Normef1.weight", "L2Normef2.weight", "L2Normef3.weight", "loc_pal1.0.weight", "loc_pal1.0.bias", "loc_pal1.1.weight", "loc_pal1.1.bias", "loc_pal1.2.weight", "loc_pal1.2.bias", "loc_pal1.3.weight", "loc_pal1.3.bias", "loc_pal1.4.weight", "loc_pal1.4.bias", "loc_pal1.5.weight", "loc_pal1.5.bias", "conf_pal1.0.weight", "conf_pal1.0.bias", "conf_pal1.1.weight", "conf_pal1.1.bias", "conf_pal1.2.weight", "conf_pal1.2.bias", "conf_pal1.3.weight", "conf_pal1.3.bias", "conf_pal1.4.weight", "conf_pal1.4.bias", "conf_pal1.5.weight", "conf_pal1.5.bias", "loc_pal2.0.weight", "loc_pal2.0.bias", "loc_pal2.1.weight", "loc_pal2.1.bias", "loc_pal2.2.weight", "loc_pal2.2.bias", "loc_pal2.3.weight", "loc_pal2.3.bias", "loc_pal2.4.weight", "loc_pal2.4.bias", "loc_pal2.5.weight", "loc_pal2.5.bias", "conf_pal2.0.weight", "conf_pal2.0.bias", "conf_pal2.1.weight", "conf_pal2.1.bias", "conf_pal2.2.weight", "conf_pal2.2.bias", "conf_pal2.3.weight", "conf_pal2.3.bias", "conf_pal2.4.weight", "conf_pal2.4.bias", "conf_pal2.5.weight", "conf_pal2.5.bias", "ref.0.weight", "ref.0.bias", "ref.3.weight", "ref.3.bias". Unexpected key(s) in state_dict: "meta", "state_dict", "optimizer".
''' How can I run your code with ExDark datasets?

ZPDu commented 6 months ago

Hi, please check the evaluation part of the README file. For ExDark, we refer you to MAET. For experimental setup and data preparation, you could follow the instructions in MAET. And you only need to place our checkpoint into their evaluation code.

wangSir0202 commented 6 months ago

Copy that, thanks a lot for your help!

ZPDu commented 5 months ago

Hi, the training code is uploaded