We evaluate our method on different datasets (including ShapeNet, CUB-200-2011, and Pascal3D+) and achieve state-of-the-art results, outperforming all the other supervised and unsupervised methods and 3D representations, all in terms of performance, accuracy, and training time.

Overview

An Effective Loss Function for Generating 3D Models from Single 2D Image without Rendering

Papers with code | Paper

Nikola Zubić   Pietro Lio  

University of Novi Sad   University of Cambridge

AIAI 2021

Citation

Besides AIAI 2021, our paper is in a Springer's book entitled "Artificial Intelligence Applications and Innovations": link

Please, cite our paper if you find this code useful for your research.

@article{zubic2021effective,
  title={An Effective Loss Function for Generating 3D Models from Single 2D Image without Rendering},
  author={Zubi{\'c}, Nikola and Li{\`o}, Pietro},
  journal={arXiv preprint arXiv:2103.03390},
  year={2021}
}

Prerequisites

  • Download code:
    Git clone the code with the following command:

    git clone https://github.com/NikolaZubic/2dimageto3dmodel.git
    
  • Open the project with Conda Environment (Python 3.7)

  • Install packages:

    conda install pytorch torchvision torchaudio cudatoolkit=11.0 -c pytorch
    

    Then git clone Kaolin library in the root (2dimageto3dmodel) folder with the following commit and run the following commands:

    cd kaolin
    python setup.py install
    pip install --no-dependencies nuscenes-devkit opencv-python-headless scikit-learn joblib pyquaternion cachetools
    pip install packaging
    

Run the program

Run the following commands from the root/code/ (2dimageto3dmodel/code/) directory:

python main.py --dataset cub --batch_size 16 --weights pretrained_weights_cub --save_results

for the CUB Birds Dataset.

python main.py --dataset p3d --batch_size 16 --weights pretrained_weights_p3d --save_results

for the Pascal 3D+ Dataset.

The results will be saved at 2dimageto3dmodel/code/results/ path.

Continue training

To continue the training process:
Run the following commands (without --save_results) from the root/code/ (2dimageto3dmodel/code/) directory:

python main.py --dataset cub --batch_size 16 --weights pretrained_weights_cub

for the CUB Birds Dataset.

python main.py --dataset p3d --batch_size 16 --weights pretrained_weights_p3d

for the Pascal 3D+ Dataset.

License

MIT

Acknowledgment

This idea has been built based on the architecture of Insafutdinov & Dosovitskiy.
Poisson Surface Reconstruction was used for Point Cloud to 3D Mesh transformation.
The GAN architecture (used for texture mapping) is a mixture of Xian's TextureGAN and Li's GAN.

Comments
  • Where is cmr_data?

    Where is cmr_data?

    Keep running into this issue from cmr_data.p3d import P3dDataset and from cmr_data.p3d import CUBDataset

    but you do not have these files in your repo. I tried using cub_200_2011_dataset.py but it does not take in the same number of arguments as the CUBDataset class used in run_reconstruction.py.

    opened by achhabria7 6
  • ModuleNotFoundError: No module named 'kaolin.graphics'

    ModuleNotFoundError: No module named 'kaolin.graphics'

    Pascal 3D+ dataset with 4722 images is successfully loaded.

    Traceback (most recent call last): File "main.py", line 149, in <module> from rendering.renderer import Renderer File "/home/ujjawal/my_work/object_recon/2d3d/code/rendering/renderer.py", line 1, in <module> from kaolin.graphics.dib_renderer.rasterizer import linear_rasterizer ModuleNotFoundError: No module named kaolin.graphics

    I also downloaded the graphics folder from here https://github.com/NVIDIAGameWorks/kaolin/tree/e7e513173bd4159ae45be6b3e156a3ad156a3eb9 and tried to place in the graphics folder in the kaolin folder locally and here is the error Traceback (most recent call last): File "main.py", line 149, in <module> from rendering.renderer import Renderer File "/home/ujjawal/my_work/object_recon/2d3d/code/rendering/renderer.py", line 1, in <module> from kaolin.graphics.dib_renderer.rasterizer import linear_rasterizer File "/usr/local/lib/python3.6/dist-packages/kaolin-0.9.0-py3.6-linux-x86_64.egg/kaolin/graphics/__init__.py", line 2, in <module> File "/usr/local/lib/python3.6/dist-packages/kaolin-0.9.0-py3.6-linux-x86_64.egg/kaolin/graphics/nmr/__init__.py", line 1, in <module> File "/usr/local/lib/python3.6/dist-packages/kaolin-0.9.0-py3.6-linux-x86_64.egg/kaolin/graphics/nmr/rasterizer.py", line 30, in <module> ImportError: cannot import name rasterize_cuda

    opened by ujjawalcse 6
  • No module named 'models.reconstruction'

    No module named 'models.reconstruction'

    Dear NikolaZubic :
    Thanks for you updated the code recently. Did you put the reconstruction.py in the models folder?When I run “python run_reconstruction.py --name pretrained_reconstruction_cub --dataset cub --batch_size 10 --generate_pseudogt” it display
    No module named 'models.reconstruction.

    opened by lw0210 2
  • inference with single RGB pictures

    inference with single RGB pictures

    Hi, I am interested with your work, it is wonderful, and I want to use my own picture to test the model, could you provided the pretrained model and inference scripts.

    opened by 523997931 2
  • can't find the pseudogt_512*512\.npz file

    can't find the pseudogt_512*512\.npz file

    Dear NikolaZubic: I want to quote your paper, but I can't find the pseudogt_512512.npz file and can't reproduce it. Can you give me the pseudogt_512512.npz file and help me reproduce it? Thanks

    opened by Yangfuha 1
  • ValueError: Training a model requires the pseudo-ground-truth to be setup beforehand.

    ValueError: Training a model requires the pseudo-ground-truth to be setup beforehand.

    I recently read your paper and was very interested in it . I want to reproduce the code of this paper. When I followed your instructions, I found it difficult for me to run the commands(python main.py --dataset cub --batch_size 16 --weights pretrained_weights_cub and python main.py --dataset p3d --batch_size 16 --weights pretrained_weights_p3d.).And the program displayed a value error that training a model requires the pseudo-ground-truth to be setup beforehand. And I don’t know how to solve the problem, so I turn to you for help.I'm sorry to bother you, but I'really eager to solve the problem. I hope to get your reply.Thank you!

    opened by lw0210 1
  • Added step: switch to the correct correct Kaolin branch

    Added step: switch to the correct correct Kaolin branch

    This step will help others to avoid the "ModuleNotFoundError: No module named kaolin.graphics" error.

    Fix to issue: https://github.com/NikolaZubic/2dimageto3dmodel/issues/2

    opened by ricklentz 1
  • Shapenet V2 not training

    Shapenet V2 not training

    Great work guys. I was able to run the code on CUB dataset. But when I tried to run training_test_shape_net.py on Shape Net v2 chair class I'm getting errors because of missing files, unmatched file names, etc.

    So it would be helpful if you provide Shapenet Dataset Folder structure and files(images, masks) description or a sample folder and clear instructions for training the model shapenet dataset. And also if possible give pre-trained weights for the Shape net dataset models

    Thank you

    opened by girishdhegde 0
  • Pretrained model

    Pretrained model

    Hi, I find it hard to understand how to train the model on ShapeNet. It would be very helpful if you can provide a pretrained model on ShapeNet planes (I need it to test the performance in my project). If the pretrained models are not available, it would also be helpful to introduce me of how to train the model on ShapeNet.

    opened by YYYYYHC 0
  • How can I train on the boat set of the Pascal 3D+ dataset

    How can I train on the boat set of the Pascal 3D+ dataset

    I find the data of trainning such as "python run_reconstruction.py --name pretrained_reconstruction_p3d --dataset p3d --optimize_z0 --batch_size 50 --tensorboard" using the data of car.mat in sfm and data folder.Even if I rename the .mat to boat.mat and using the boat imageNet in Pascal 3D+ dataset,I find the shape of the result is more like a car not a boat.So I am wondering how to train the boat set.

    opened by lisentao 0
  • Custom Dataset

    Custom Dataset

    Hi!

    Love the work you guys have done. I am currently conducting a research. Could you please tell me how I would train on a custom dataset and how I would infer an image or create a 3d model out an image with pretrained weights that you have provided?

    opened by mahnoor-fatima-saad 0
  • How do I make my own dataset?

    How do I make my own dataset?

    Dear NikolaZubic: I want to use my own data set to replace the cub or P3D data set for training. Do you have any attention or requirements for images when making data sets?

    opened by lw0210 0
Releases(metadata)
Owner
Nikola Zubić
Interested in Artificial intelligence, Visual Computing and Cognitive science. For future AI projects: @reinai
Nikola Zubić
[NeurIPS 2020] This project provides a strong single-stage baseline for Long-Tailed Classification, Detection, and Instance Segmentation (LVIS).

A Strong Single-Stage Baseline for Long-Tailed Problems This project provides a strong single-stage baseline for Long-Tailed Classification (under Ima

Kaihua Tang 514 Dec 23, 2022
MolRep: A Deep Representation Learning Library for Molecular Property Prediction

MolRep: A Deep Representation Learning Library for Molecular Property Prediction Summary MolRep is a Python package for fairly measuring algorithmic p

AI-Health @NSCC-gz 83 Dec 24, 2022
A Collection of Papers and Codes for ICCV2021 Low Level Vision and Image Generation

A Collection of Papers and Codes for ICCV2021 Low Level Vision and Image Generation

196 Jan 05, 2023
DeepSpeed is a deep learning optimization library that makes distributed training easy, efficient, and effective.

DeepSpeed is a deep learning optimization library that makes distributed training easy, efficient, and effective.

Microsoft 8.4k Jan 01, 2023
Implementation of " SESS: Self-Ensembling Semi-Supervised 3D Object Detection" (CVPR2020 Oral)

SESS: Self-Ensembling Semi-Supervised 3D Object Detection Created by Na Zhao from National University of Singapore Introduction This repository contai

125 Dec 23, 2022
The world's largest toxicity dataset.

The Toxicity Dataset by Surge AI Saving the internet is fun. Combing through thousands of online comments to build a toxicity dataset isn't. That's wh

Surge AI 134 Dec 19, 2022
Visualizing Yolov5's layers using GradCam

YOLO-V5 GRADCAM I constantly desired to know to which part of an object the object-detection models pay more attention. So I searched for it, but I di

Pooya Mohammadi Kazaj 200 Jan 01, 2023
A demonstration of using a live Tensorflow session to create an interactive face-GAN explorer.

Streamlit Demo: The Controllable GAN Face Generator This project highlights Streamlit's new hash_func feature with an app that calls on TensorFlow to

Streamlit 257 Dec 31, 2022
【ACMMM 2021】DSANet: Dynamic Segment Aggregation Network for Video-Level Representation Learning

DSANet: Dynamic Segment Aggregation Network for Video-Level Representation Learning (ACMMM 2021) Overview We release the code of the DSANet (Dynamic S

Wenhao Wu 46 Dec 27, 2022
harmonic-percussive-residual separation algorithm wrapped as a VST3 plugin (iPlug2)

Harmonic-percussive-residual separation plug-in This work is a study on the plausibility of a sines-transients-noise decomposition inspired algorithm

Derp Learning 9 Sep 01, 2022
Low-code/No-code approach for deep learning inference on devices

EzEdgeAI A concept project that uses a low-code/no-code approach to implement deep learning inference on devices. It provides a componentized framewor

On-Device AI Co., Ltd. 7 Apr 05, 2022
Artificial Neural network regression model to predict the energy output in a combined cycle power plant.

Energy_Output_Predictor Artificial Neural network regression model to predict the energy output in a combined cycle power plant. Abstract Energy outpu

1 Feb 11, 2022
Pytorch implementation of MalConv

MalConv-Pytorch A Pytorch implementation of MalConv Desciprtion This is the implementation of MalConv proposed in Malware Detection by Eating a Whole

Alexander H. Liu 58 Oct 26, 2022
2 Jul 19, 2022
Very simple NCHW and NHWC conversion tool for ONNX. Change to the specified input order for each and every input OP. Also, change the channel order of RGB and BGR. Simple Channel Converter for ONNX.

scc4onnx Very simple NCHW and NHWC conversion tool for ONNX. Change to the specified input order for each and every input OP. Also, change the channel

Katsuya Hyodo 16 Dec 22, 2022
Dynamic Realtime Animation Control

Our project is targeted at making an application that dynamically detects the user’s expressions and gestures and projects it onto an animation software which then renders a 2D/3D animation realtime

Harsh Avinash 10 Aug 01, 2022
Vis2Mesh: Efficient Mesh Reconstruction from Unstructured Point Clouds of Large Scenes with Learned Virtual View Visibility ICCV2021

Vis2Mesh This is the offical repository of the paper: Vis2Mesh: Efficient Mesh Reconstruction from Unstructured Point Clouds of Large Scenes with Lear

71 Dec 25, 2022
torchlm is aims to build a high level pipeline for face landmarks detection, it supports training, evaluating, exporting, inference(Python/C++) and 100+ data augmentations

💎A high level pipeline for face landmarks detection, supports training, evaluating, exporting, inference and 100+ data augmentations, compatible with torchvision and albumentations, can easily instal

DefTruth 142 Dec 25, 2022
HiFi-GAN: Generative Adversarial Networks for Efficient and High Fidelity Speech Synthesis

HiFi-GAN: Generative Adversarial Networks for Efficient and High Fidelity Speech Synthesis Jungil Kong, Jaehyeon Kim, Jaekyoung Bae In our paper, we p

Rishikesh (ऋषिकेश) 31 Dec 08, 2022
DNA-RECON { Automatic Web Reconnaissance Tool }

ABOUT TOOL : DNA-RECON is an automatic web reconnaissance tool written in python. This tool made for reconnaissance and information gathering with an

NIKUNJ BHATT 25 Aug 11, 2021