Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,7 +29,7 @@ session = onnxruntime.InferenceSession(str(model_path), providers=['CUDAExecutio
|
|
| 29 |
|
| 30 |
# Generate random colors for each class
|
| 31 |
np.random.seed(42)
|
| 32 |
-
colors = np.random.uniform(0, 255, size=(80, 3))
|
| 33 |
|
| 34 |
total_inference_time = 0
|
| 35 |
inference_count = 0
|
|
@@ -43,7 +43,7 @@ def detect_objects(image):
|
|
| 43 |
start_time = time.time()
|
| 44 |
|
| 45 |
image = cv2.resize(image, (416, 416))
|
| 46 |
-
image = image.astype(np.float32) / 255.0
|
| 47 |
image = np.transpose(image, (2, 0, 1))
|
| 48 |
image = np.expand_dims(image, axis=0)
|
| 49 |
|
|
|
|
| 29 |
|
| 30 |
# Generate random colors for each class
|
| 31 |
np.random.seed(42)
|
| 32 |
+
colors = np.random.uniform(0, 255, size=(80, 3))
|
| 33 |
|
| 34 |
total_inference_time = 0
|
| 35 |
inference_count = 0
|
|
|
|
| 43 |
start_time = time.time()
|
| 44 |
|
| 45 |
image = cv2.resize(image, (416, 416))
|
| 46 |
+
image = image.astype(np.float32) / 255.0
|
| 47 |
image = np.transpose(image, (2, 0, 1))
|
| 48 |
image = np.expand_dims(image, axis=0)
|
| 49 |
|