Spaces:
Runtime error
Runtime error
thinh-huynh-re
commited on
Commit
·
dd7849d
1
Parent(s):
e5b9cea
Fix
Browse files- run_opencv.py +5 -1
run_opencv.py
CHANGED
@@ -53,7 +53,11 @@ class ActivityModel:
|
|
53 |
def load_json(self):
|
54 |
if args.id2label is not None:
|
55 |
with open(args.id2label, encoding="utf-8") as f:
|
56 |
-
|
|
|
|
|
|
|
|
|
57 |
|
58 |
def load_model(
|
59 |
self, model_name: str
|
|
|
53 |
def load_json(self):
|
54 |
if args.id2label is not None:
|
55 |
with open(args.id2label, encoding="utf-8") as f:
|
56 |
+
tmp = json.load(f)
|
57 |
+
d = dict()
|
58 |
+
for key, item in tmp.items():
|
59 |
+
d[int(key)] = item
|
60 |
+
self.model.config.id2label = d
|
61 |
|
62 |
def load_model(
|
63 |
self, model_name: str
|