Spaces:
Sleeping
Sleeping
Commit
·
f5aeda9
1
Parent(s):
a857acc
Update model.py
Browse files
model.py
CHANGED
@@ -80,10 +80,10 @@ class Model(LabelStudioMLBase):
|
|
80 |
'type': 'rectangle',
|
81 |
'score': score.item(), # per-region score, visible in the editor
|
82 |
'value': {
|
83 |
-
'x': x.item(),
|
84 |
-
'y': y.item(),
|
85 |
-
'width': (x2-x).item(),
|
86 |
-
'height': (y2-y).item(),
|
87 |
'rotation': 0,
|
88 |
}
|
89 |
})
|
@@ -96,10 +96,10 @@ class Model(LabelStudioMLBase):
|
|
96 |
'type': 'labels',
|
97 |
'score': score.item(), # per-region score, visible in the editor
|
98 |
'value': {
|
99 |
-
'x': x.item(),
|
100 |
-
'y': y.item(),
|
101 |
-
'width': (x2-x).item(),
|
102 |
-
'height': (y2-y).item(),
|
103 |
'rotation': 0,
|
104 |
'labels': [self.id2label[label.item()]]
|
105 |
}
|
|
|
80 |
'type': 'rectangle',
|
81 |
'score': score.item(), # per-region score, visible in the editor
|
82 |
'value': {
|
83 |
+
'x': x.item() * 100.0 / original_width,
|
84 |
+
'y': y.item() * 100.0 / original_height,
|
85 |
+
'width': (x2-x).item() * 100.0 / original_width,
|
86 |
+
'height': (y2-y).item() * 100.0 / original_height,
|
87 |
'rotation': 0,
|
88 |
}
|
89 |
})
|
|
|
96 |
'type': 'labels',
|
97 |
'score': score.item(), # per-region score, visible in the editor
|
98 |
'value': {
|
99 |
+
'x': x.item() * 100.0 / original_width,
|
100 |
+
'y': y.item() * 100.0 / original_height,
|
101 |
+
'width': (x2-x).item() * 100.0 / original_width,
|
102 |
+
'height': (y2-y).item() * 100.0 / original_height,
|
103 |
'rotation': 0,
|
104 |
'labels': [self.id2label[label.item()]]
|
105 |
}
|