Spaces:
Running
on
Zero
Running
on
Zero
Fix importing main library before upgrading to git main with pip
Browse files
app.py
CHANGED
@@ -1,36 +1,36 @@
|
|
|
|
1 |
import subprocess
|
2 |
import sys
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
8 |
|
9 |
# -----------------------------------------------|
|
10 |
|
11 |
-
|
12 |
|
13 |
-
|
14 |
-
subprocess.run((
|
15 |
-
sys.executable, "-m", "uv", "pip", "install", "--upgrade",
|
16 |
-
"git+https://github.com/BrokenSource/BrokenSource@main",
|
17 |
-
"git+https://github.com/BrokenSource/ShaderFlow@main",
|
18 |
-
"git+https://github.com/BrokenSource/DepthFlow@main",
|
19 |
-
))
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
|
32 |
# -----------------------------------------------|
|
33 |
|
|
|
|
|
34 |
DepthGradio().launch(
|
35 |
workers=4,
|
36 |
nvenc=True,
|
|
|
1 |
+
import os
|
2 |
import subprocess
|
3 |
import sys
|
4 |
|
5 |
+
# Install latest git main code
|
6 |
+
bool(os.getenv("SPACES_ZERO_GPU")) and subprocess.run((
|
7 |
+
sys.executable, "-m", "uv", "pip", "install", "--upgrade",
|
8 |
+
"git+https://github.com/BrokenSource/BrokenSource@main",
|
9 |
+
"git+https://github.com/BrokenSource/ShaderFlow@main",
|
10 |
+
"git+https://github.com/BrokenSource/DepthFlow@main",
|
11 |
+
))
|
12 |
|
13 |
# -----------------------------------------------|
|
14 |
|
15 |
+
from DepthFlow.Webui import ESTIMATORS, UPSCALERS
|
16 |
|
17 |
+
from Broken.Externals.Depthmap import DepthAnythingV2
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
+
# Remove legacy upscalers
|
20 |
+
UPSCALERS.pop("Real-ESRGAN")
|
21 |
+
UPSCALERS.pop("Waifu2x")
|
22 |
|
23 |
+
# Remove unsuitable models
|
24 |
+
ESTIMATORS.clear()
|
25 |
+
ESTIMATORS.update({
|
26 |
+
# Base and Large models are CC BY-NC 4.0, better safe than sorry
|
27 |
+
"DepthAnything2": DepthAnythingV2(model=DepthAnythingV2.Model.Small),
|
28 |
+
})
|
29 |
|
30 |
# -----------------------------------------------|
|
31 |
|
32 |
+
from DepthFlow.Webui import DepthGradio
|
33 |
+
|
34 |
DepthGradio().launch(
|
35 |
workers=4,
|
36 |
nvenc=True,
|