Git Product home page Git Product logo

faceformer's Introduction

Neural Face Identification in a 2D Wireframe Projection of a Manifold Object

IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) 2022

arXiv Conference

Requirements

conda env create --file environment.yml
conda activate faceformer

Download Dataset

We use CAD mechanical models from ABC dataset. In order to reproduce our results, we also release the dataset used in the paper here. If you would like to build the dataset by yourself, please refer to here.

Evaluation

Face Identification Model

Trained models can be downloaded here.

python main.py --config-file configs/{MODEL_NAME}.yml --test_ckpt trained_models/{MODEL_NAME}.ckpt

Face predictions will be saved to lightning_logs/version_{LATEST}/json.

3D Reconstruction

# wireframe reconstruction
python reconstruction/reconstruct_to_wireframe.py --root lightning_logs/version_{LATEST}
# surface reconstruction
python reconstruction/reconstruct_to_mesh.py --root lightning_logs/version_{LATEST}

Reconstructed wireframes (.ply) or meshes (obj) files will be saved to lightning_logs/version_{LATEST}/{ply/obj}

Train a Model from Scratch

python main.py --config_file configs/{MODEL_NAME}.yml

FAQs

  • Why does root_dir not update when I change it in configs/ours.yml?
    Seems like when pytorch_lightning loads the checkpoint in, it also uses the old root dir which we trained the model with. To fix: Please uncomment line 25 of faceformer/trainer.py and set the desired root_dir there.

  • How should I use the downloaded json dataset?
    Assuming we have downloaded data_ours.tar.gz and unzipped it to the same directory as split_json.py in the outer-most directory, we now have:

    root
    ├── main.py
    ├── split_json.py
    ├── ours
    │   └── 00000050.json
    │   └── 00000052.json
    │   └── ...
    

    Run python split_json.py and it should prepare the dataset into the following:

    root
    ├── main.py
    ├── split_json.py
    ├── ours
    │   └── test.txt
    │   └── train.txt
    │   └── valid.txt
    │   └── json
    │       └── 00000050.json
    │       └── 00000052.json
    │       └── ...
    

    With this, set the root_dir to "ours" at line 25 of faceformer/trainer.py, and

    python main.py --config-file configs/ours.yml --test_ckpt trained_models/ours.ckpt
    

    should work.

Acknowledgement

The work was done during Kehan Wang's internship at Manycore Tech Inc.

faceformer's People

Contributors

bertjiazheng avatar jason-khan avatar

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.