• Stars
    star
    452
  • Rank 96,506 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 1 year ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DragGAN meets GET3D for interactive mesh generation and editing.

Drag3D: DragGAN meets GET3D

This project extends the idea of DragGAN into the GET3D to enable interactive generation and drag editing of textured meshes.

A GUI is implemented for demonstration:

drag3d_car.mp4
drag3d_chair.mp4
drag3d_animals.mp4

Thanks @SteveJunGao for helping to create the demo video for animals!

Install

# download
git clone https://github.com/ashawkey/Drag3D.git
cd Drag3D

# dependency
pip install -r requirements.txt

# (optional) get a better font to display
wget https://github.com/lxgw/LxgwWenKai/releases/download/v1.300/LXGWWenKai-Regular.ttf

Download pretrained GET3D checkpoints from here and put them under ./pretrained_model.

Tested Environment

  • Ubuntu 20 + V100 + CUDA 11.6 + torch 1.12.0
  • Windows 10 + 3070 + CUDA 12.1 + torch 2.1.0

You need to have an OpenGL direct rendering enabled display to use the GUI.

The required GPU memory is about 4 GB.

NOTE: For Unix-based OS, we could only use the CUDA context of nvdiffrast in GUI, which seems to show some rendering artifacts when the mesh is too far from camera (triangles too small). Windows is recommended.

Usage

basics

# run gui
python gui.py --outdir trial_car --resume_pretrain pretrained_model/shapenet_car.pt

You need to click get to generate a 3D model first, and use geo or tex to resample geometry or texture.

Then, operate the GUI by:

  • Left drag: rotate camera.
  • Middle drag: pan camera.
  • Scroll: scale camera.
  • Right click: add / select source point.
  • Right drag: drag target point.

After adding at least one point pair, click train to start optimization.

You can repeat these steps until getting satisfying shapes.

Finally, click save to export the current textured mesh.

bounding box mask loss (experimental)

In GUI, you could check bbox loss and adjust the bounding box to constrain the optimization, like the 2D mask loss.

The part outside the bounding box will be encouraged to remain unchanged.

The learning rate and loss weight can be adjusted in GUI to achieve a balance. A large lr (0.01) or smaller loss weight (1.0) maybe helpful if the point won't move after applying bbox loss.

Acknowledgement

  • DragGAN:

    @inproceedings{pan2023draggan,
      title={Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold}, 
      author={Pan, Xingang and Tewari, Ayush, and Leimk{\"u}hler, Thomas and Liu, Lingjie and Meka, Abhimitra and Theobalt, Christian},
      booktitle = {ACM SIGGRAPH 2023 Conference Proceedings},
      year={2023}
    }
  • GET3D:

    @inproceedings{gao2022get3d,
      title={GET3D: A Generative Model of High Quality 3D Textured Shapes Learned from Images},
      author={Jun Gao and Tianchang Shen and Zian Wang and Wenzheng Chen and Kangxue Yin
      and Daiqing Li and Or Litany and Zan Gojcic and Sanja Fidler},
      booktitle={Advances In Neural Information Processing Systems},
      year={2022}
    }

More Repositories

1

stable-dreamfusion

Text-to-3D & Image-to-3D & Mesh Exportation with NeRF + Diffusion.
Python
7,270
star
2

torch-ngp

A pytorch CUDA extension implementation of instant-ngp (sdf and nerf), with a GUI.
Python
1,863
star
3

nerf2mesh

[ICCV2023] Delicate Textured Mesh Recovery from NeRF via Adaptive Surface Refinement
Python
743
star
4

RAD-NeRF

Real-time Neural Radiance Talking Portrait Synthesis via Audio-spatial Decomposition
Python
707
star
5

diff-gaussian-rasterization

Cuda
308
star
6

Segment-Anything-NeRF

Segment-anything interactively in NeRF.
Python
277
star
7

chatgpt_please_improve_my_paper_writing

a thin wrapper of chatgpt for improving paper writing.
Python
251
star
8

torch-merf

An unofficial pytorch implementation of MeRF
Python
137
star
9

dreamfields-torch

A pytorch implementation of dreamfields with modifications.
Python
134
star
10

fantasia3d.unofficial

An unofficial reproduction of Fantasia3D
Python
127
star
11

CCNeRF

[NeurIPS 2022] Compressible-composable NeRF via Rank-residual Decomposition.
Python
125
star
12

nerf_template

a simple template for practicing NeRF.
Python
125
star
13

cubvh

CUDA Mesh BVH tools.
Cuda
121
star
14

jiif

[ACM MM 2021] Joint Implicit Image Function for Guided Depth Super-Resolution
Python
90
star
15

raytracing

A CUDA Mesh RayTracer with BVH acceleration, with python bindings and a GUI.
Cuda
83
star
16

volumentations

3D volume data augmentation package inspired by albumentations
Python
78
star
17

kiuikit

A maintained, reusable and trustworthy toolkit for computer vision tasks.
Python
42
star
18

envlight

Environment light tools.
Python
38
star
19

FocalLoss.pytorch

Implementation of focal loss in pytorch for unbalanced classification.
Python
35
star
20

dimr

[ECCV 2022] Disentangled Instance Mesh Reconstruction
Python
27
star
21

NotVeryFastNeRF

an unofficial and partial implementation of FastNeRF
Jupyter Notebook
25
star
22

note

notebook archive
PowerShell
19
star
23

3d_human_poser

a naive 3d human pose editor GUI.
Python
16
star
24

vscode-mesh-viewer

A 3D mesh viewer for vscode
JavaScript
16
star
25

CCA

CCA, DCCA, DCCAE, ConvCCA
Python
14
star
26

grid_put

An operation trying to do the opposite of F.grid_sample
Python
13
star
27

index_grid_sample

Extension to `F.grid_sample` that allows using batch index per grid point.
Cuda
12
star
28

made-in-heaven-timer

create timer videos at any speed.
Python
11
star
29

q10r

A simple web questionnaire application.
Python
6
star
30

ddddsr

A python library for end-to-end image super resolution.
Python
5
star
31

lightnet

light weight convolutional neural network implementation in one c++ file.
C++
5
star
32

bsp_cvae

Python
4
star
33

learn_matmul

Cuda
3
star
34

trojan-privoxy-client

for unraid proxy.
Dockerfile
2
star
35

numpytorch

Monkey-patched numpy with pytorch syntax
Python
2
star
36

point_seg_dist

a CUDA implementation of points to lines/segments distance
C
2
star
37

pytorch_ddp_examples

Python
1
star
38

uuunet

Python
1
star
39

fbxloader

FBX file loader for python (only supports geometry currently)
Python
1
star
40

unraid_tutorial

2021εΉ΄ηš„unraid搭建教程
1
star
41

CapsNet.pytorch

reimplementation of capsule network for MNIST classification.
Python
1
star
42

Uncertainty

program to calculate uncertainty for Physics experiment.
Python
1
star
43

nonsense

NoNSeNSe frontend.
JavaScript
1
star
44

JLGCN

Joing learning of graphs and features
Python
1
star
45

live-speech-recognition

A simple sliding window based real-time speech recognition example.
Python
1
star
46

dullPLYviewer

HTML
1
star
47

MaxClique

Heuristic algorithms to solve the max clique problem.
C++
1
star
48

hawtorch

pytorch extensions for code reuse
Python
1
star