Giter VIP home page Giter VIP logo

justusschock / deep_alignment_network_pytorch Goto Github PK

View Code? Open in Web Editor NEW
38.0 3.0 8.0 5.93 MB

PyTorch Implementation of the Deep Alignment Network

Home Page: https://justusschock.github.io/deep_alignment_network_pytorch/

License: BSD 2-Clause "Simplified" License

Python 79.22% Jupyter Notebook 20.78%
deep-alignment-network face-alignment landmark-detection facial-landmarks pytorch pytorch-cnn delira

deep_alignment_network_pytorch's Introduction

Deep Alignment Network PyTorch

Build Status codecov

This repository contains a delira-compatible implementation of the Deep Alignment Network.

The original implementation can be found here and the paper is available on arXiv

An example using the HELEN dataset can be found in the notebooks folder.

Installation

This repository can be installed from pip via:

pip install deep-alignment-pytorch

or from source via

pip install git+https://github.com/justusschock/deep_alignment_network_pytorch

An installation from pip will be possible soon, once the complete repository setup is completed.

Poster (taken from original implementation)

deep_alignment_network_pytorch's People

Contributors

justusschock 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

Watchers

 avatar  avatar  avatar

deep_alignment_network_pytorch's Issues

DAN Use

Can you gave a test example?

Questions about environment and package version.

I tried to run your code, but it seems incompatible. First of all, I run under python3.7: pip install deep-alignment-pytorch.
But I got the following error:
image
Then I went back to 3.6 and anaconda to try to install, but it also failed.
Finally I tried to use google colab, it worked miraculously.
But I still encountered many problems, including TensorFlow version problems, path loss problems, etc., but I have solved them. But in the end, during training, I got a problem I couldn't solve:
image
Can you give me some suggestions, I will be very grateful!

Hi some problems about image transform.

sorry to take your time! I used your imagetransfrom layer, landmarkstransfrom layer and the Heatmap layer for some tests. When the estimatetransform layer process a affine matrix. the landmarks are good to be transformed. But the image is not transformed, the transformed image become almost black!
the images are all [batch, 3, 256, 256]
Here is my define:
mean_shape = torch.Tensor(np.load("meanshape.npy")) trafo_param_layer = EstimateAffineParams(mean_shape.squeeze(0)) img_trafo_layer = AffineImageTransformation((256, 256)) landmark_trafo_layer = AffineLandmarkTransformation() heatmap_layer = HeatMap((256, 256), 32)
Here is my transform process:
affine_params = trafo_param_layer(out.data.cpu()) transformed_img = img_trafo_layer(inp.data.cpu(), affine_params) transformed_lmks = landmark_trafo_layer(out.data.cpu(), affine_params) heatmap = heatmap_layer(transformed_lmks)
Here is my debug show:
ori_inp = inp.data.cpu().numpy() debug_inp = transformed_img.numpy() debug_lmk = transformed_lmks.numpy() for num in range(out.size(0)): plt.imshow(ori_inp[num].transpose(1,2,0)) plt.show() plt.imshow(debug_inp[num].transpose(1,2,0)) plt.plot(debug_lmk[num][:,0], debug_lmk[num][:,1], ".") plt.show()
Figure_1
It is the result. I don't know why the transformed image is wrong? can you help me? please! Thank you!

Change loss and network structure

  1. I try to run your code, but I got this:./dataset/trainset is not a valid directory and It happened in
    Traceback (most recent call last): File "preprocess.py", line 57, in <module> random_scale=RANDOM_SCALE File "/home/wqzhaha/anaconda3/envs/py36_torch_gpu/lib/python3.6/site-packages/shapedata/single_shape/dataset.py", line 161, in __init__ img_files = make_dataset(data_path) File "/home/wqzhaha/anaconda3/envs/py36_torch_gpu/lib/python3.6/site-packages/shapedata/utils.py", line 36, in make_dataset assert os.path.isdir(dir), '%s is not a valid directory' % dir AssertionError: ./data/dataset/trainset/ is not a valid directory
  2. if I want to do some experiment about changing the structure of network and changing the loss function, where should I modify?

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.