Spaces:
Running
on
Zero
Running
on
Zero
Upload folder using huggingface_hub
Browse files- gradio_cache/1/input.png +0 -0
- gradio_cache/1/rembg.png +0 -0
- gradio_cache/1/white_mesh.glb +0 -0
- gradio_cache/1/white_mesh.html +57 -0
- hg_app.py +1 -1
gradio_cache/1/input.png
ADDED
|
gradio_cache/1/rembg.png
ADDED
|
gradio_cache/1/white_mesh.glb
ADDED
|
Binary file (721 kB). View file
|
|
|
gradio_cache/1/white_mesh.html
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html>
|
| 3 |
+
|
| 4 |
+
<head>
|
| 5 |
+
<!-- Import the component -->
|
| 6 |
+
<script src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.1.1/model-viewer.min.js" type="module"></script>
|
| 7 |
+
|
| 8 |
+
<script>
|
| 9 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 10 |
+
const modelViewers = document.querySelectorAll('model-viewer');
|
| 11 |
+
|
| 12 |
+
modelViewers.forEach(modelViewer => {
|
| 13 |
+
modelViewer.addEventListener('load', (event) => {
|
| 14 |
+
const [material] = modelViewer.model.materials;
|
| 15 |
+
let color = [43, 44, 46, 255];
|
| 16 |
+
color = color.map(x => x / 255);
|
| 17 |
+
material.pbrMetallicRoughness.setMetallicFactor(0.1); // 完全金属
|
| 18 |
+
material.pbrMetallicRoughness.setRoughnessFactor(0.7); // 低粗糙度
|
| 19 |
+
material.pbrMetallicRoughness.setBaseColorFactor(color); // CornflowerBlue in RGB
|
| 20 |
+
});
|
| 21 |
+
});
|
| 22 |
+
});
|
| 23 |
+
</script>
|
| 24 |
+
|
| 25 |
+
<style>
|
| 26 |
+
body {
|
| 27 |
+
margin: 0;
|
| 28 |
+
font-family: Arial, sans-serif;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.centered-container {
|
| 32 |
+
display: flex;
|
| 33 |
+
justify-content: center;
|
| 34 |
+
align-items: center;
|
| 35 |
+
border-radius: 8px;
|
| 36 |
+
border-color: #e5e7eb;
|
| 37 |
+
border-style: solid;
|
| 38 |
+
border-width: 1px;
|
| 39 |
+
}
|
| 40 |
+
</style>
|
| 41 |
+
</head>
|
| 42 |
+
|
| 43 |
+
<body>
|
| 44 |
+
<div class="centered-container">
|
| 45 |
+
|
| 46 |
+
<div class="column is-mobile is-centered">
|
| 47 |
+
<model-viewer style="height: 586px; width: 700px;" rotation-per-second="10deg" id="modelViewer"
|
| 48 |
+
src="./white_mesh.glb/" disable-tap
|
| 49 |
+
environment-image="neutral" auto-rotate camera-target="0m 0m 0m" orientation="0deg 0deg 170deg" shadow-intensity=".9"
|
| 50 |
+
ar auto-rotate camera-controls>
|
| 51 |
+
</model-viewer>
|
| 52 |
+
</div>
|
| 53 |
+
|
| 54 |
+
</div>
|
| 55 |
+
</body>
|
| 56 |
+
|
| 57 |
+
</html>
|
hg_app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# pip install gradio==4.44.1
|
| 2 |
-
if
|
| 3 |
import os
|
| 4 |
import spaces
|
| 5 |
import subprocess
|
|
|
|
| 1 |
# pip install gradio==4.44.1
|
| 2 |
+
if False:
|
| 3 |
import os
|
| 4 |
import spaces
|
| 5 |
import subprocess
|