File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,20 @@ def main():
111
111
112
112
from cvat .apps .engine .serializers import LabeledDataSerializer
113
113
114
+ # NOTE: We're actually using `run_inference_engine_annotation`
115
+ # incorrectly here. The `mapping` dict is supposed to be a mapping
116
+ # of integers -> integers and represents the transition from model
117
+ # integers to the labels in the database. We're using a mapping of
118
+ # integers -> strings. For testing purposes, this shortcut is fine.
119
+ # We just want to make sure everything works. Until, that is....
120
+ # we want to test using the label serializer. Then we have to transition
121
+ # back to integers, otherwise the serializer complains about have a string
122
+ # where an integer is expected. We'll just brute force that.
123
+
124
+ for shape in results ['shapes' ]:
125
+ # Change the english label to an integer for serialization validation
126
+ shape ['label_id' ] = 1
127
+
114
128
serializer = LabeledDataSerializer (data = results )
115
129
116
130
if not serializer .is_valid ():
You can’t perform that action at this time.
0 commit comments