Giter Site home page Giter Site logo

naoto0804 / cross-domain-detection Goto Github PK

View Code? Open in Web Editor NEW
416.0 11.0 74.0 1.89 MB

Cross-Domain Weakly-Supervised Object Detection through Progressive Domain Adaptation [Inoue+, CVPR2018].

Home Page: https://naoto0804.github.io/cross_domain_detection/

Python 97.27% Shell 2.73%
object-detection weakly-supervised-learning cross-domain chainer domain-adaptation

cross-domain-detection's Introduction

Naoto's github stats

cross-domain-detection's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cross-domain-detection's Issues

the speed of train become lower

when i trained the model . at first ,the time of one iters is quick, but it became slower and slower . i donot know why,but i am not familiar with chainer ,.can you help me .

Training with own dataset.

Hi, Thanks for the amazing paper and this repository.
I am trying to implement this repository with my own dataset. I have a different number of classes. Can you give me any idea how can I do that?

The training setting for the CycelGAN

Can you provide more details about the training process of CyceGeAN? During the image translating form VOC to Clipart, did you use all the clipart1k images or just the train set(not including the test dataset)?

Preparing data

Hi,

Im actually coming from other repo: https://github.com/VisionLearningGroup/DA_Detection

The repo direct me here to prepare data for clipart and watermark. However after scan through your code, it seems that your label for clipart and watermark are generated by applying SSD detection on original image? (pseudo_label.py)

Could you please give a hint on the label generation for clipart and watermark?

Are the annotation files stored in Annotations/ after I follow the
'Training using virtually created instance-level annotations'
are the ground truth label?

The problem of pseudo_label

excuse me ,I have the following problem when I run pseudo_label , because the path is wrong? And I didn't find the 0001.jpg used in your path.Can you help me with your answer? thank you very much.
(C:\Users\pf\Anaconda3) D:\cross-domain-detection-master>python pseudo_label.py --root datasets/clipart --data_type clipart --det_type ssd300 --gpu 0 --load models/clipart_dt_ssd300 --result datasets/dt_pl_clipart
32 of 500 images, 15.42 FPSTraceback (most recent call last):
File "pseudo_label.py", line 92, in
main()
File "pseudo_label.py", line 82, in main
labeler = LabelFile(filename, img_path, dataset.actual_labels)
File "D:\cross-domain-detection-master\lib\label_file.py", line 20, in init
assert(os.path.exists(imagePath))
AssertionError

Some issues about requirements

  When I recommended `pip install -r requirements.txt`,an error came out:Could not find a version that satisfies the requirement pkg-resources==0.0.0 (from -r requirements.txt (line 13)) (from versions: )

No matching distribution found for pkg-resources==0.0.0 (from -r requirements.txt (line 13))
Then.I read the requirement.txt. It was pkg-resources==0.0.0.
So is it a clerical error?

Problems for fine-tuning

I know that there are two steps for fin-tuning the pretrained SSD300. But from the codes, I do not see the implement processes for these steps. I guess the images in the loaded dataset with instance-level annotations are generated from the PL process. Am I right?

DT step for train

excuse me ,i use the code to do domain transfer step but i onlt get snapshot file not the model file .is it nomal ,how can i get the dt model.please help me

Dataset preparation for DT

Hello,
when reading your paper, in the implementation stage it says all images were resized 286x282, then for finetuning they where randomly cropped to 256x256 was this done through the already existing CycleGAN options https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix (such as --preprocessing parameter in the command line) or separately before calling the train.py command?

Missing test jpg set in prepare_dt.sh

We downloaded the prepare_dt.sh but couldn't find the test set jpgs. It occurs to me that the train jpgs exists, but somehow the test ones are gone. I wonder where they are; can you help me?

FileNotFoundError

FileNotFoundError: [Errno 2] No such file or directory:'datasets/dt_clipart/VOC2012/ImageSets/Main/test.txt‘

when i train Domain transfer (DT) step,
python train_model.py --root datasets/dt_clipart/VOC2007 --root datasets/dt_clipart/VOC2012 --subset train --result result/dt_clipart --det_type ssd300 --data_type clipart --gpu 0 --max_iter 500

Where are the models saved after training ?

I followed the training steps. The only results i got are in the result directory, nothing was stored on to the models directory. Where are the trained models saved ? How do i perform demo with my trained model ?

Problem in dataset clipart

I got an AssertionError when I ran pseudo_label.py:

python pseudo_label.py --root datasets/clipart --data_type clipart --det_type ssd300 --gpu 0 --load models/clipart_dt_ssd300 --result datasets/dt_pl_clipart
32 of 500 samples, 8.59 samples/sec, ETA    0:00:54
Traceback (most recent call last):
  File "pseudo_label.py", line 95, in <module>
    main()
  File "pseudo_label.py", line 85, in main
    labeler = LabelFile(filename, img_path, dataset.actual_labels)
  File "/data/chenfan/cross-domain-detection/lib/label_file.py", line 20, in __init__
    assert(os.path.exists(imagePath))
AssertionError

and I print(img_path) got this:datasets/dt_pl_clipart/JPEGImages/322583407.jpg. Then I go to datasets/clipart and I found that 322583407 is in ImageSets/train.txt but there is no such image as 322583407.jpg in JPEGImages, I'm sure I've downloaded the dataset, so maybe there is a missing image in this dataset?

How to train with multi GPU

Hi, I wonder how to train with multi GPU. When I used three GPU to train, I found that only one GPU was used. My training set is --gpu 2. Looking forward to your reply @naoto0804

ADDA with SSD300

Hello @naoto0804 ,
Thanks for your good work and for the interesting paper.
I would be interested in replicating the detection results you obtained aligning the features extracted by the SSD with the ADDA method, as introduced in section 5.1.
Could you please give me more details about the training procedure, in particular regarding the architecture you used for the domain discriminator? Which features does the discriminator receive? Did you use the same learning rate for both domain discriminator and feature extractor?
Thank you

Cannot reproduce provided DT images

I am trying to replicate your DT step (VOC2<clipart/comic/watercolor>) for my research, but quality of transferred images I obtain from CycleGAN is substantially inferior to quality of the ones you provide, which impact final results.

  • I am using this implementation of CycleGAN, which should be the same you used according to the readme.

  • I am using the full trainval sets of VOC2007 + VOC2012 (trainA) and one among clipart1k, comic2k and watercolor2k (trainB).

  • I follow the hyperparameters reported in the paper: I run cyclegan for 20 epochs (10 + 10 linear lr decay to zero) with an initial learning rate of 1e-5 using adam optimizer. All other hyperparameters are left at their default values.

Perhaps there's something I am missing, maybe I am using the wrong datasets or the wrong set of hyperparameters, are the steps I described consistent with yours?

Results on adpatation from PASCAL VOC to Clipart Dataset does not match

I am trying to get the results in table 3 for Baseline but it does not match with the paper, can you provide more details on the specifics please.

  1. For training on the baseline you mentioned to use VOC2007 and 2012, should i convert them via cyclegan first or baseline means just training on original VOC2007 + 2012 images?

  2. also you mentioned in the paper that:
    For the target-domain images, the ones with instance-level annotations were used when discussing the performance gap between our methods and the ideal case quantitatively. The target-domain images were split into training set and test set by a ratio of 1:1. For the training set, the bounding box information was ignored to meet the proposed situation.
    can you please clarify what do you mean by: the ones with instance-level annotations were used when discussing the performance gap between our methods and the ideal case quantitatively.

  3. when I download the clipart data set it includes test and train, are the results reported on the paper for baseline computed by training on VOC2007 + 2012 and test on test images in clipart (500 images) or test on the total images in the clipart (1000 images)

Thank you!

The problem of training

Thanks for your work !!! When I tried to train the model using "python train_model.py --root datasets/clipart --subset train --result result --det_type ssd300 --data_type clipart --gpu 0", it worked only 16 epoches by Titan XP. Do you have any advice?
捕获

About domain transfer settins

Hi, @naoto0804 I wonder the specific settings of domain transfer method.
For example,
train A: images of VOC2007, the trainval part
train B: images of clipart, the train part
test A uses the same images as train A, test B uses the same images as train B
Is it right?

I would like to know the details about fine-tune in your paper

image
I want to know how to do fine-tune?It's just use source domain FSD as a pre-train model,and start faster rcnn again?Maybe it will lead to catastrophic forgetting according to incremental learning knowledge.So maybe I misunderstand the meaning of fine-tune,how we execute find-tune? This problem has troubled me for a long time. Thank you

fine tuning in DT and PL steps?

When I read your paper, FSD is fined-tuned both in DT and PL steps,.
But, I can't find fine tuning code in your git code.
Can you explain where the fine tuning part is in your code?
Thank you.

why the mAP decreases when i train the model by the following step?

I'm trying to reconstruct the experiment. The step i do is as the following:
1.DT
python train_model.py --root datasets/dt_clipart/VOC2007 --root datasets/dt_clipart/VOC2012 --subset train --result result/dt_clipart --det_type ssd300 --data_type clipart --gpu 0 --max_iter 500 --load models/clipart_dt_ssd300 --eval_root datasets/clipart
2.PL
(1)get labels
python pseudo_label.py --root datasets/clipart --data_type clipart --det_type ssd300 --gpu 0 --load result/dt_clipart/model_iter_10000 --result datasets/dt_pl_clipart
(2)fine-tune
python train_model.py --root datasets/dt_pl_clipart --subset train --result result/dt_pl_clipart --det_type ssd300 --data_type clipart --gpu 0 --load result/dt_clipart/model_iter_10000 --eval_root datasets/clipart

Questions:
1.In step1, there is no test.txt in the path:datasets/dt_datasets/dt_clipart/VOC2012/ImageSets/Main.
when i do step1, the code throwed an error, then i looked the content of the files in folder Main. Finally, i choose val.txt as the test.txt to evaluate the mAP in step1.
Is this way correct?

2.From the result of doing the three steps, i find the mAP in step1 is 0.6834. And after step3, the final mAP is 0.435. The iteration is 10000, batchsize is 16. I want to know if I made a mistake in some steps ?

3.How can i use the extra dataset in the experiment of watercolor part ?

I look forward to hearing from you.

Issues with prepare_dt.sh script

There seems to be an issue with the curl command, maybe the file doesnt exist? Or something changed with the url? It's strange because it was working fine last week and I've curled from a few different ips and getting the same error. I'm also able to run the prepare.sh script with no problems

curl: (28) Failed to connect to www.hal.t.u-tokyo.ac.jp port 80 after 133021 ms: Couldn't connect to server
unzip:  cannot find or open dt_datasets.zip, dt_datasets.zip.zip or dt_datasets.zip.ZIP.
rm: cannot remove 'dt_datasets.zip': No such file or directory 

Image size does not match in Clipart1k

Hi, thanks for sharing the datasets. I find a mismatch issue about an image and its annotation.

The image JPEGImages/681633840.jpg in Clipart1k dataset has a size of 300*213. But its annotation Annotations/681633840.xml shows it should have a width of 600 and a height of 594.

I try to resize the image to the size provided in the annotation. However, bounding boxes cannot cover objects correctly.

image

The pre-trained CycleGAN model

According to the guidelines of the datasets file, we downloaded the "Clipart1k", "PASCAL-VOC", and "domain-transformed PASCAL-VOC" datasets. However, we couldn't download the "source-transformed Clipart1k" datasets which is generated by the CycleGAN. Can you provide us the pre-trained cyclegan model which maps Clipart1k to source-transformed Clipart1k?

numpy.ufuc has the wrong size

i use conda to create a new environment。 after i pip the require.txt and run the demo,i got
ValueError:numpy.ufunc has the wrong size,try recompiling. Expected 192 ,got 216

multi GPU

hello

Can the model train on more than one GPUs ?

I've got a problem installing opencv in requirements

I'm working on this in a docker
and I tried, to install the required part from an anaconda pip
where I got this

Collecting opencv-python==3.4.1.15 (from -r requirements.txt (line 11)) ERROR: Could not find a version that satisfies the requirement opencv-python==3.4.1.15 (from -r requirements.txt (line 11)) (from versions: none) ERROR: No matching distribution found for opencv-python==3.4.1.15 (from -r requirements.txt (line 11))

Can I use an alternative to this?

Installing in docker with cuda 10.1 segmentfault

root@crossdomain:/workspace/cross-domain-detection# python eval_model.py --root datasets/clipart --data_type clipart --det_type ssd300 --gpu 0 --load models/cli part_dt_pl_ssd300 /opt/conda/lib/python3.6/site-packages/chainercv/links/model/ssd/ssd_vgg16.py:24 5: RuntimeWarning: cv2 is not installed on your environment. Pretrained models a re trained with cv2. The performace may change with Pillow backend. RuntimeWarning) Segmentation fault (core dumped)

When I got to build this code, this error interrupted the execution.
Is there any one knew what happened?
Thers is a core dump file

some supplimentary info:

Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007fd7073fb75c in elf_machine_rela (skip_ifunc=0, reloc_addr_arg=0x7fd6ee5e6f40, version=0x48, sym=0x7fd6ee2db4c0, reloc=0x7fd6ee2f0640, map=0x5582cfd5ecb0) at ../sysdeps/x86_64/dl-machine.h:303

Besides
I run the python

chainer.cuda.get_device_from_id(0).use()

it works well, but while running in script, it caused a segment fault.
I tried many times, it only works when I append this code just after the import of chainer
What the Hell is it??????

the output of circle GAN

excuse me , the circle GAN i used only can output the transformed picture with resolution (256*256),but i noticed that your dt dataset pictures have same resolution as VOC。if possible can you provide the GAN code you used or tell me something about how to modified the GAN net.
thanks a lot.

Eval only works on first 16 images

Hi, when I try to evaluate the models, it finishes after 16 images.

python eval_model.py --root datasets/clipart --data_type clipart --det_type ssd300 --gpu 0 --load models/clipart_dt_pl_ssd300

16 of 500 images, 1.04 FPS
mAP: 45.838514
[0.35795296 0.6231405 0.25748064 0.45363873 0.2972707 0.75524476
0.46959915 0.02931454 0.5259346 0.72092924 0.5014015 0.19371956
0.40696306 0.8219697 0.61909188 0.41884568 0.24460997 0.38183322
0.49152827 0.59723416]

Also, I would like to know how to change the eval function in order to evaluate on the baseline. I know the questions are stupid, but I have never used Chainer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.