Spaces:
Sleeping
Sleeping
Update pipeline/rtlucassen_wrapper.py
Browse files
pipeline/rtlucassen_wrapper.py
CHANGED
|
@@ -1,10 +1,15 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
def is_ready():
|
| 3 |
-
|
|
|
|
|
|
|
| 4 |
|
| 5 |
def run_bline_detector(_video_or_frames):
|
| 6 |
repo_ok, weights_ok = is_ready()
|
| 7 |
-
if not repo_ok:
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
| 10 |
return [0,1,2,1,0], [1,1,1,1,1]
|
|
|
|
| 1 |
import os
|
| 2 |
+
|
| 3 |
def is_ready():
|
| 4 |
+
repo_ok = os.path.isdir("external/B-line_detection")
|
| 5 |
+
weights_ok = os.path.isdir("models/rtlucassen")
|
| 6 |
+
return repo_ok, weights_ok
|
| 7 |
|
| 8 |
def run_bline_detector(_video_or_frames):
|
| 9 |
repo_ok, weights_ok = is_ready()
|
| 10 |
+
if not repo_ok:
|
| 11 |
+
raise RuntimeError("Original repo missing: external/B-line_detection")
|
| 12 |
+
if not weights_ok:
|
| 13 |
+
raise RuntimeError("Weights missing. Put authorized BEDLUS weights in models/rtlucassen/")
|
| 14 |
+
# Placeholder until real inference is wired
|
| 15 |
return [0,1,2,1,0], [1,1,1,1,1]
|