Giter Club home page Giter Club logo

3dkeypoints-da's Introduction

Unsupervised Domain Adaptation for 3D Keypoint Estimation via View Consistency

This repository is the PyTorch implementation for the network presented in:

Xingyi Zhou, Arjun Karpur, Chuang Gan, Linjie Luo, Qixing Huang, Unsupervised Domain Adaptation for 3D Keypoint Estimation via View Consistency ECCV 2018(arXiv:1712.05765)

Contact: [email protected]

Requirements

Data

  • The following datasets are used in this repo. If you use the data provided, please also consider citing them:
  • Download the pre-processing data and annotations here, and un-zip them on data.

Testing

  • Download our pre-trained model on Redwood Depth dataset and move it to models.
  • Run the test.
 python main.py -expID demo -loadModel ../models/Redwood.pth.tar -test
  • Visualize the results.
python tools/vis.py ../exp/Chair/demo/img_valTarget ../exp/Chair/demo/valTarget.txt

Training

  • Stage1: Train the source model.
python main.py -expID Source -epochs 120 -dropLR 90

Our results of this stage is provided here.

  • Stage2: Adapt to the target domain with shape consistency loss.
python main.py -expID Redwood -targetDataset Redwood -targetRatio 1 -shapeWeight 1 -loadModel ../models/ModelNet120.tar -LR 0.01

3dkeypoints-da's People

Contributors

xingyizhou 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  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

3dkeypoints-da's Issues

Requirements.txt

Thank you so much for providing the code.
Although you mention the dependencies in README, the version information, especially for pytorch and torchvision, is missing. It would be very helpful and nice if you could also provide requirements.txt.

Positions of key points under same unit

Hello, thanks for your open code! Are the positions of the key points under the three directions in the same unit? Thank you very much!

``
pts = np.zeros((self.nViews, ref.J, 3), dtype = np.float32)
pts[v] = self.annot[index, vv].copy()
return inp, pts, meta

Backward error in ShapeConsistencyCriterion.py

When I download the datasets and run python main.py -expID Source -epochs 120 -dropLR 90 to train the source model, an error happened.

Environment

  • Python2.7
  • PyTorch0.4.0
  • Torchvision 0.2.2

Traceback

Traceback (most recent call last):
  File "main.py", line 152, in <module>
    main()
  File "main.py", line 98, in main
    epoch)
  File "/home/inoue/experiment/da_regression/3DKeypoints-DA/src/train.py", line 79, in train
    return step(args, 'train', epoch, train_loader, model, optimizer, M=M)
  File "/home/inoue/experiment/da_regression/3DKeypoints-DA/src/train.py", line 65, in step
    loss.backward()
  File "/home/inoue/experiment/.cuda10_pt_0_4_py2_env/local/lib/python2.7/site-packages/torch/tensor.py"
, line 93, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/home/inoue/experiment/.cuda10_pt_0_4_py2_env/local/lib/python2.7/site-packages/torch/autograd/_
_init__.py", line 89, in backward
    allow_unreachable=True)  # allow_unreachable flag
  File "/home/inoue/experiment/da_regression/3DKeypoints-DA/src/layers/ShapeConsistencyCriterion.py", li
ne 74, in backward
    g, v]) / ref.J / 3 / self.nViews / G
RuntimeError: expand(torch.FloatTensor{[10, 3]}, size=[30]): the number of sizes provided (1) must be gr
eater or equal to the number of dimensions in the tensor (2)

it seems that there is shape mismatch between grad_input[g * self.nViews + v] and points[g, v] - target[g, v].
Do you have any suggestion to solve the error?

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.