Unique3D icon indicating copy to clipboard operation
Unique3D copied to clipboard

if you increase resolution to 8192 and use pytorch3d, a single 4090 can generate production ready models in about 5 minutes

Open pharrowboy opened this issue 1 year ago • 15 comments

hi, im using an older version where pytorch3d was used before nvdiffrast was implemented. and i noticed if you bump the resolution to 8192, unique3d is able to generate production ready models.

nvdiffrast is limited to a resolution of 2048, and this limitation holds the program back significantly. there are artifacts in some models when using 2048 resolution.

but with 8192 resolution, the models can be production ready, have look at the videos to see the quality. the eye model had artifacts in the demo, before i bumped it up to 8192. upon raising the resolution the artifacts went away

https://github.com/AiuniAI/Unique3D/assets/11796091/80e47969-6945-4418-a2e8-92e364b2ecdf

https://github.com/AiuniAI/Unique3D/assets/11796091/dc2ad584-cd2a-400e-9043-ce34dfe4ec86

pharrowboy avatar Jun 18 '24 00:06 pharrowboy

Those results look amazing, would you be able to write up the setup process for the older version you're using?

TheArchetypes avatar Jun 18 '24 02:06 TheArchetypes

its pretty simple. download the current version and uncomment line 101 of project_mesh.py and comment next line after it. then set the resolution variable anywhere its found within that file from 512 to 8192. its hard encoded in every function to a lower value.

make sure you have a 24GB vram gpu and 64GB of ram, because the high resolution will spill over a bit into cpu ram, but the speed is still decent, it will say it will take like hours to finish, but then atleast for me it sped up, and finished in 3-5 minutes.

pharrowboy avatar Jun 18 '24 05:06 pharrowboy

Could you please upload the modified file? I changed the code but it doesn't generate the same good result as yours using the same picture. image

Humanoid-z avatar Jun 19 '24 03:06 Humanoid-z

@Humanoid-z Use the version here https://huggingface.co/spaces/Wuvin/Unique3D/tree/main

The line 101 is just a comment line though:

image

https://huggingface.co/spaces/Wuvin/Unique3D/blob/main/scripts/project_mesh.py

Would you mind show your detail changes ?

emperor1412 avatar Jun 22 '24 17:06 emperor1412

@Humanoid-z Use the version here https://huggingface.co/spaces/Wuvin/Unique3D/tree/main

The line 101 is just a comment line though:

image

https://huggingface.co/spaces/Wuvin/Unique3D/blob/main/scripts/project_mesh.py

Would you mind show your detail changes ?

that version is already using pytorch, i was refering to the github version

download that spaces one and just edit the resolution.

pharrowboy avatar Jun 22 '24 17:06 pharrowboy

@Humanoid-z Use the version here https://huggingface.co/spaces/Wuvin/Unique3D/tree/main

The line 101 is just a comment line though: image https://huggingface.co/spaces/Wuvin/Unique3D/blob/main/scripts/project_mesh.py Would you mind show your detail changes ?

that version is already using pytorch, i was refering to the github version

download that spaces one and just edit the resolution.

Thanks for the confirmation.

Do you appear to know how to get this model output unwrapped mesh with UV and textures instead of heavy vertex colors mesh ? Or is there a way to achieve this by combining other projects somehow ?

emperor1412 avatar Jun 23 '24 16:06 emperor1412

its pretty simple. download the current version and uncomment line 101 of project_mesh.py and comment next line after it. then set the resolution variable anywhere its found within that file from 512 to 8192. its hard encoded in every function to a lower value.

make sure you have a 24GB vram gpu and 64GB of ram, because the high resolution will spill over a bit into cpu ram, but the speed is still decent, it will say it will take like hours to finish, but then atleast for me it sped up, and finished in 3-5 minutes.

How much of this ram are you sharing with gpu? 64gb shared?

LucioC avatar Jun 24 '24 05:06 LucioC

hi, im using an older version where pytorch3d was used before nvdiffrast was implemented. and i noticed if you bump the resolution to 8192, unique3d is able to generate production ready models.

nvdiffrast is limited to a resolution of 2048, and this limitation holds the program back significantly. there are artifacts in some models when using 2048 resolution.

but with 8192 resolution, the models can be production ready, have look at the videos to see the quality. the eye model had artifacts in the demo, before i bumped it up to 8192. upon raising the resolution the artifacts went away

Recording.2024-06-17.181808.mp4 Recording.2024-06-17.181757.mp4

Can you help me with this issue here? https://github.com/AiuniAI/Unique3D/issues/61 It would be greatly appreciated and you likely have some insight.

KenNavarro730 avatar Jul 08 '24 12:07 KenNavarro730

i forgot to mention that after changing the resolution in the files i used a 8192x8192 image file that is perfectly square. if the image is not 8192x8192 to begin with then changing the resolution to 8192 in the project file wont do much.

i used AI upscaling to scale my images to 8192x8192, that seemed to help alot

pharrowboy avatar Aug 02 '24 00:08 pharrowboy

your link requires access permission to see it. but anyways one thing i noticed was that images of your object need to be looking dead center at the camera. and i've gotten the best results from using an image of a character that are not turning away or angled oddly, and without fingers exposed. see the examples below

DALL·E 2024-07-07 23 26 25 - A hyper-realistic, full-body front view image of a one-eyed lumpy green monster in a T-pose, but shorter in height for easier viewing  The monster has-standard-height-2048px1 Screenshot 2024-08-02 082558

pharrowboy avatar Aug 02 '24 14:08 pharrowboy

In the project_mesh.py file, I replaced all '512' and '1024' with 8192 and in the following line ret = project_color(meshes, camera, image, eps=eps, resolution=8192, device=device, use_alpha=use_alpha) I set the resolution to 8192 so all the calls from other functions will use that resolution. Input image is 8192x8192. But I haven't seen any big improvement, Am i missing something important?

mattia-z avatar Aug 13 '24 11:08 mattia-z

@pharrowboy @mattia-z Can you upload the updated files? in the space resolution is a parameter with the value hardcoded. Is that what you are saying to change? I'm a little confused as others and this is a very interesting improvement to test.

josepmy avatar Aug 17 '24 23:08 josepmy

@josepmy sorry for the long wait, I just cloned the repo from Hugging face and in the file unique3d/scripts/project_mesh.py, I change all the paramters "resolution to 8192" so basically i replaced all the value like 512 or 1024 with 8192. And I upscaled my input image to 8192x8192. But I've not noticed any quality improvement

mattia-z avatar Sep 01 '24 10:09 mattia-z