Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -60,17 +60,18 @@ MAX_IMAGE_RES = (1920, 1080)
|
|
60 |
MAX_VIDEO_MB = 50
|
61 |
MAX_VIDEO_DURATION = 30 # seconds
|
62 |
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
74 |
|
75 |
|
76 |
# Utility Functions
|
|
|
60 |
MAX_VIDEO_MB = 50
|
61 |
MAX_VIDEO_DURATION = 30 # seconds
|
62 |
|
63 |
+
|
64 |
+
# @spaces.GPU
|
65 |
+
# def preload_models():
|
66 |
+
# """
|
67 |
+
# This function is needed to activate ZeroGPU. It must be decorated with @spaces.GPU.
|
68 |
+
# It can be used to warm up models or load them into memory.
|
69 |
+
# """
|
70 |
+
# from registry import get_model
|
71 |
+
# print("Warming up models for ZeroGPU...")
|
72 |
+
# get_model("detection", "yolov5n-seg", device="cpu")
|
73 |
+
# get_model("segmentation", "deeplabv3_resnet50", device="cpu")
|
74 |
+
# get_model("depth", "midas_v21_small_256", device="cpu")
|
75 |
|
76 |
|
77 |
# Utility Functions
|