Spaces:
Runtime error
Runtime error
Martin Tomov
commited on
run_length_encoding syntax error fix
Browse files
app.py
CHANGED
|
@@ -37,8 +37,8 @@ class DetectionResult:
|
|
| 37 |
def from_dict(cls, detection_dict: Dict) -> 'DetectionResult':
|
| 38 |
return cls(
|
| 39 |
score=detection_dict['score'],
|
| 40 |
-
label
|
| 41 |
-
box
|
| 42 |
xmin=detection_dict['box']['xmin'],
|
| 43 |
ymin=detection_dict['box']['ymin'],
|
| 44 |
xmax=detection_dict['box']['xmax'],
|
|
@@ -170,7 +170,8 @@ def run_length_encoding(mask):
|
|
| 170 |
rle.append(count)
|
| 171 |
count = 1
|
| 172 |
last_val = pixel
|
| 173 |
-
if count > 0
|
|
|
|
| 174 |
return rle
|
| 175 |
|
| 176 |
def detections_to_json(detections):
|
|
|
|
| 37 |
def from_dict(cls, detection_dict: Dict) -> 'DetectionResult':
|
| 38 |
return cls(
|
| 39 |
score=detection_dict['score'],
|
| 40 |
+
label: detection_dict['label'],
|
| 41 |
+
box: BoundingBox(
|
| 42 |
xmin=detection_dict['box']['xmin'],
|
| 43 |
ymin=detection_dict['box']['ymin'],
|
| 44 |
xmax=detection_dict['box']['xmax'],
|
|
|
|
| 170 |
rle.append(count)
|
| 171 |
count = 1
|
| 172 |
last_val = pixel
|
| 173 |
+
if count > 0:
|
| 174 |
+
rle.append(count)
|
| 175 |
return rle
|
| 176 |
|
| 177 |
def detections_to_json(detections):
|