Tremeschin commited on
Commit
cccc7e4
·
unverified ·
1 Parent(s): b499d22

Fix importing main library before upgrading to git main with pip

Browse files
Files changed (1) hide show
  1. app.py +21 -21
app.py CHANGED
@@ -1,36 +1,36 @@
 
1
  import subprocess
2
  import sys
3
 
4
- from DepthFlow.Webui import ESTIMATORS, UPSCALERS, DepthGradio
5
-
6
- from Broken import Runtime
7
- from Broken.Externals.Depthmap import DepthAnythingV2
 
 
 
8
 
9
  # -----------------------------------------------|
10
 
11
- if Runtime.ZeroGPU:
12
 
13
- # Install latest git main code
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
- # Remove legacy upscalers
22
- UPSCALERS.pop("Real-ESRGAN")
23
- UPSCALERS.pop("Waifu2x")
24
 
25
- # Remove unsuitable models
26
- ESTIMATORS.clear()
27
- ESTIMATORS.update({
28
- # Base and Large models are CC BY-NC 4.0, better safe than sorry
29
- "DepthAnything2": DepthAnythingV2(model=DepthAnythingV2.Model.Small),
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,