Spaces:
Runtime error
Runtime error
update
Browse files- README.md +1 -1
- app.py +29 -8
- requirements.txt +1 -1
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 🖼
|
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: red
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version: 4.
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
|
|
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: red
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.41.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
app.py
CHANGED
|
@@ -26,14 +26,35 @@ else:
|
|
| 26 |
).to(device)
|
| 27 |
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
def generate_default_uv(mesh, quality='medium'):
|
| 38 |
"""
|
| 39 |
Generate default UV coordinates for a mesh if UV mapping is missing.
|
|
|
|
| 26 |
).to(device)
|
| 27 |
|
| 28 |
|
| 29 |
+
import csv
|
| 30 |
+
import sys
|
| 31 |
+
import os
|
| 32 |
+
# Get the current working directory
|
| 33 |
+
CURRENT_DIR = os.getcwd()
|
| 34 |
+
|
| 35 |
+
# Define example file paths using the current directory
|
| 36 |
+
DEFAULT_OBJ_FILE = os.path.join(CURRENT_DIR, "female.obj")
|
| 37 |
+
DEFAULT_GLB_FILE = os.path.join(CURRENT_DIR, "vroid_girl1.glb")
|
| 38 |
+
DEFAULT_VRM_FILE = os.path.join(CURRENT_DIR, "fischl.vrm")
|
| 39 |
+
DEFAULT_VRM_FILE2 = os.path.join(CURRENT_DIR, "woman.vrm")
|
| 40 |
+
DEFAULT_VRM_FILE3 = os.path.join(CURRENT_DIR, "mona.vrm")
|
| 41 |
+
DEFAULT_TEXTURE = os.path.join(CURRENT_DIR, "future.png")
|
| 42 |
+
DEFAULT_TEXTURE2 = os.path.join(CURRENT_DIR, "woman1.jpeg")
|
| 43 |
+
DEFAULT_TEXTURE3 = os.path.join(CURRENT_DIR, "woman2.jpeg")
|
| 44 |
+
|
| 45 |
+
# Ensure all example files exist
|
| 46 |
+
example_files = [
|
| 47 |
+
[DEFAULT_VRM_FILE, DEFAULT_TEXTURE],
|
| 48 |
+
[DEFAULT_OBJ_FILE, None],
|
| 49 |
+
[DEFAULT_GLB_FILE, None],
|
| 50 |
+
[DEFAULT_VRM_FILE2, DEFAULT_TEXTURE2],
|
| 51 |
+
[DEFAULT_VRM_FILE3, DEFAULT_TEXTURE3]
|
| 52 |
+
]
|
| 53 |
+
for example in example_files:
|
| 54 |
+
for file in example:
|
| 55 |
+
if file and not os.path.exists(file):
|
| 56 |
+
print(f"Warning: Example file {file} does not exist!")
|
| 57 |
+
|
| 58 |
def generate_default_uv(mesh, quality='medium'):
|
| 59 |
"""
|
| 60 |
Generate default UV coordinates for a mesh if UV mapping is missing.
|
requirements.txt
CHANGED
|
@@ -5,6 +5,6 @@ transformers==4.44.0
|
|
| 5 |
xformers==0.0.27.post2
|
| 6 |
pillow==10.4.0
|
| 7 |
trimesh==4.4.4
|
| 8 |
-
gradio==4.
|
| 9 |
pythreejs==2.4.2
|
| 10 |
plotly==5.23.0
|
|
|
|
| 5 |
xformers==0.0.27.post2
|
| 6 |
pillow==10.4.0
|
| 7 |
trimesh==4.4.4
|
| 8 |
+
gradio==4.41.0
|
| 9 |
pythreejs==2.4.2
|
| 10 |
plotly==5.23.0
|