Spaces:
Runtime error
Runtime error
valentynliubchenko commited on
Commit ·
7a9e429
1
Parent(s): f122098
added trace
Browse files
app.py
CHANGED
|
@@ -5,13 +5,23 @@ import numpy as np
|
|
| 5 |
|
| 6 |
model_options = ["xViewyolov8n_v8_100e.pt", "xViewyolov8s_v8_100e.pt", "xViewyolov8m_v8_100e.pt"]
|
| 7 |
model_names = ["Nano", "Small", "Medium"]
|
| 8 |
-
|
| 9 |
example_list = [["./examples/" + example] for example in os.listdir("examples")]
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
def process_image(input_image, model_name, conf):
|
|
|
|
|
|
|
|
|
|
| 12 |
print(model_name)
|
|
|
|
| 13 |
print(conf)
|
|
|
|
| 14 |
model_index = model_names.index(model_name)
|
|
|
|
|
|
|
| 15 |
model = models[model_index]
|
| 16 |
|
| 17 |
results = model.predict(input_image, conf=conf)
|
|
|
|
| 5 |
|
| 6 |
model_options = ["xViewyolov8n_v8_100e.pt", "xViewyolov8s_v8_100e.pt", "xViewyolov8m_v8_100e.pt"]
|
| 7 |
model_names = ["Nano", "Small", "Medium"]
|
| 8 |
+
print("befora loading examples")
|
| 9 |
example_list = [["./examples/" + example] for example in os.listdir("examples")]
|
| 10 |
+
print("befora loading models")
|
| 11 |
+
models = [YOLO(os.path.join("./saved_model", option)) for option in model_options]
|
| 12 |
+
print("finish preparation")
|
| 13 |
|
| 14 |
def process_image(input_image, model_name, conf):
|
| 15 |
+
print('input_image: ')
|
| 16 |
+
print(input_image)
|
| 17 |
+
print('model_name: ')
|
| 18 |
print(model_name)
|
| 19 |
+
print('conf: ')
|
| 20 |
print(conf)
|
| 21 |
+
print('start processing: ')
|
| 22 |
model_index = model_names.index(model_name)
|
| 23 |
+
print('model_index: ')
|
| 24 |
+
print(model_index)
|
| 25 |
model = models[model_index]
|
| 26 |
|
| 27 |
results = model.predict(input_image, conf=conf)
|