Spaces:
Runtime error
Runtime error
Update model.py
Browse files
model.py
CHANGED
|
@@ -36,7 +36,9 @@ class Model:
|
|
| 36 |
) -> tuple[list[np.ndarray] | tuple[list[np.ndarray],
|
| 37 |
list[list[np.ndarray]]]
|
| 38 |
| dict[str, np.ndarray], np.ndarray]:
|
|
|
|
| 39 |
out = self.detect(image)
|
|
|
|
| 40 |
vis = self.visualize_detection_results(image, out, score_threshold)
|
| 41 |
return out, vis
|
| 42 |
|
|
@@ -44,7 +46,9 @@ class Model:
|
|
| 44 |
self, image: np.ndarray
|
| 45 |
) -> list[np.ndarray] | tuple[
|
| 46 |
list[np.ndarray], list[list[np.ndarray]]] | dict[str, np.ndarray]:
|
|
|
|
| 47 |
out = inference_detector(self.model, image)
|
|
|
|
| 48 |
return out
|
| 49 |
|
| 50 |
def visualize_detection_results(
|
|
|
|
| 36 |
) -> tuple[list[np.ndarray] | tuple[list[np.ndarray],
|
| 37 |
list[list[np.ndarray]]]
|
| 38 |
| dict[str, np.ndarray], np.ndarray]:
|
| 39 |
+
print('Image1', image.shape)
|
| 40 |
out = self.detect(image)
|
| 41 |
+
print('Out1', out)
|
| 42 |
vis = self.visualize_detection_results(image, out, score_threshold)
|
| 43 |
return out, vis
|
| 44 |
|
|
|
|
| 46 |
self, image: np.ndarray
|
| 47 |
) -> list[np.ndarray] | tuple[
|
| 48 |
list[np.ndarray], list[list[np.ndarray]]] | dict[str, np.ndarray]:
|
| 49 |
+
print('Image2', image.shape)
|
| 50 |
out = inference_detector(self.model, image)
|
| 51 |
+
print('Out2',out)
|
| 52 |
return out
|
| 53 |
|
| 54 |
def visualize_detection_results(
|