Download 3DArena/data/export.py from slongle/3DEval: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/datasets/slongle/3DEval/resolve/main/3DArena/data/export.py
- Command line
-
hf download hf://datasets/slongle/3DEval/3DArena/data/export.py
-
curl -L -o export.py https://huggingface.co/datasets/slongle/3DEval/resolve/main/3DArena/data/export.py
1.26 kB
| import os | |
| import json | |
| import shutil | |
| def mkdir(path): | |
| if not os.path.exists(path): | |
| os.makedirs(path) | |
| prompts = [ | |
| "A_cartoon_house_with_red_roof", | |
| "A_castle_made_of_cardboard", | |
| "A_heart_made_of_wood", | |
| ] | |
| methods = ["Unique3D", "MeshFormer", "Meshy", "InstantMesh"] | |
| export_root = "export_data" | |
| mkdir(export_root) | |
| for method in methods: | |
| mkdir(os.path.join(export_root, method)) | |
| for i in range(len(prompts)): | |
| mkdir(os.path.join(export_root, method, str(i))) | |
| model_src = os.path.join("outputs", method, f"{prompts[i]}.glb") | |
| model_dst = os.path.join(export_root, method, str(i), "model.glb") | |
| shutil.copy(model_src, model_dst) | |
| prompts = [prompt.replace("_", " ").strip() for prompt in prompts] | |
| json.dump(prompts, open(os.path.join(export_root, "prompt.json"), "w"), indent=4) | |
| """ | |
| |--- data/ | |
| |--- prompt.json | |
| |--- method_name_0/ | |
| | |--- 0/ # prompt[0] | |
| | | |--- model.glb | |
| | |--- 1/ # prompt[1] | |
| | |--- model.glb | |
| | | |
| |--- method_name_1/ | |
| | |--- 0/ # prompt[0] | |
| | | |--- model.glb | |
| | |--- 1/ # prompt[1] | |
| | |--- model.glb | |
| """ | |