Giter Club home page Giter Club logo

wsddn.pytorch's Introduction

WSDDN PyTorch

Implementation of Weakly Supervised Deep Detection Networks using the latest version of PyTorch.

Bilen, H., & Vedaldi, A. (2016). Weakly supervised deep detection networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (pp. 2846-2854).

Implementation Differences

  • Adam optimizer (instead of SGD)
  • Spatial regulariser isn't added

Experiments

  • VGG16 based model is closest to EB + Box Sc. case with model L, which reported 30.4 mAP in the paper
  • AlexNet based model is closest to EB + Box Sc. case with model S, which reported 33.4 mAP in the paper
  • Results when VGG16 is used as base model
aero bike bird boat bottle bus car cat chair cow table dog horse mbike person plant sheep sofa train tv mean
41.4 46.3 22.7 24.5 13.6 57.7 49.9 31.1 7.5 31.1 24.3 25.9 38.7 53.5 7.2 13.9 31.1 38.6 48.3 39.0 32.3
  • Results when AlexNet is used as base model
aero bike bird boat bottle bus car cat chair cow table dog horse mbike person plant sheep sofa train tv mean
38.1 41.5 27.1 18.6 10.3 48.8 47.6 36.8 1.6 25.9 28.5 30.4 39.7 46.8 15.1 12.4 28.3 32.4 44.2 44.8 30.9

Requirements

Build Steps

git clone [email protected]:adursun/wsddn.pytorch.git
cd wsddn.pytorch
./prepare.sh
docker run --rm --gpus all --ipc=host -v `pwd`:/ws -it wsddn.pytorch /bin/bash

Training Steps

# for VGG based model
python src/train.py --base_net vgg

Evaluation Steps

# for VGG based model
# run `wget "https://www.dropbox.com/s/xyi4hgms6y3ldmj/vgg_epoch_20.pt?dl=1" -P states/` to use pretrained weights
python src/evaluate.py --base_net vgg --state_path states/vgg_epoch_20.pt

wsddn.pytorch's People

Contributors

adursun avatar dependabot[bot] avatar fatihbaltaci avatar

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

Watchers

 avatar  avatar  avatar  avatar

wsddn.pytorch's Issues

How to train the network without Ens?

Hello, how does the network proposed in this paper realize Ensemble Learning(Ens)? How can I train the network without Ensemble Learning(Ens)?

I encountered a problem when I adjusted the batchsize to 2

Thank you for sharing your code,but wen i tried to adjust the batchsize to 2,i got this:
Traceback (most recent call last):
File "src/train.py", line 84, in
) in tqdm(train_dl, f"Epoch {epoch}"):
File "/home/lzr/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/tqdm/std.py", line 1129, in iter
for obj in iterable:
File "/home/lzr/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 345, in next
data = self._next_data()
File "/home/lzr/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 856, in _next_data
return self._process_data(data)
File "/home/lzr/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 881, in _process_data
data.reraise()
File "/home/lzr/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/_utils.py", line 394, in reraise
raise self.exc_type(msg)
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/lzr/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "/home/lzr/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
return self.collate_fn(data)
File "/home/lzr/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 79, in default_collate
return [default_collate(samples) for samples in transposed]
File "/home/lzr/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 79, in
return [default_collate(samples) for samples in transposed]
File "/home/lzr/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 64, in default_collate
return default_collate([torch.as_tensor(b) for b in batch])
File "/home/lzr/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 55, in default_collate
return torch.stack(batch, 0, out=out)
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 516 and 900 in dimension 2 at /pytorch/aten/src/TH/generic/THTensor.cpp:612

have you meet this problem?

how to use the method in my own dataset, and the dataset is voc format

Hello, if I want to use this algorithm in my own data, a remote sensing image dataset. How should I modify the codes.
In addition, what algorithm should I choose to generate proposals and how to format the proposal files to match this detector.

Thank you very much for your reply.

RuntimeError: Error(s) in loading state_dict for WSDDN:

Hey bro, when I tried to run the command:
python3.7 src/evaluate.py --state_path="./states/epoch_20_with_scores.pt"

I got this:
Traceback (most recent call last):
File "src/evaluate.py", line 22, in
net.load_state_dict(torch.load(args.state_path))
File "/usr/local/python3/lib/python3.7/site-packages/torch/serialization.py", line 387, in load
return _load(f, map_location, pickle_module, **pickle_load_args)
File "/usr/local/python3/lib/python3.7/site-packages/torch/serialization.py", line 574, in _load
result = unpickler.load()
File "/usr/local/python3/lib/python3.7/site-packages/torch/serialization.py", line 537, in persistent_load
deserialized_objects[root_key] = restore_location(obj, location)
File "/usr/local/python3/lib/python3.7/site-packages/torch/serialization.py", line 119, in default_restore_location
result = fn(storage, location)
File "/usr/local/python3/lib/python3.7/site-packages/torch/serialization.py", line 99, in _cuda_deserialize
return storage_type(obj.size())
File "/usr/local/python3/lib/python3.7/site-packages/torch/cuda/init.py", line 599, in _lazy_new
return super(_CudaBase, cls).new(cls, *args, **kwargs)
KeyboardInterrupt

Would you like to tell me how to use the saved model args to do evaluate?

TypeError: __call__() got an unexpected keyword argument 'image'

Hi!I'm trying to run train.py to train the network but I'm having this problem:
TypeError: call() got an unexpected keyword argument 'image'
and It seems that the problem is in this part of utils.py:
image
how can I solve the problem,I'm not sure if it's the code or me, thank you!

low map issue...

After getting 10th epoch model. The program evaluated this model and returned a series of results. But it seems that the results are very low...
3c4e8a1ec68c927d3a1a4fdea0a0363

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.