Update xd-violence.py
Browse files- xd-violence.py +4 -3
xd-violence.py
CHANGED
@@ -266,11 +266,13 @@ class XDViolence(datasets.GeneratorBasedBuilder):
|
|
266 |
)
|
267 |
|
268 |
if frame_annotation_path: # test set
|
269 |
-
print(frame_annotation_path)
|
270 |
id2frame_annotation = {}
|
|
|
|
|
271 |
|
272 |
url_components = urllib.parse.urlparse(frame_annotation_path)
|
273 |
is_url = url_components.scheme in ("http", "https")
|
|
|
274 |
if is_url:
|
275 |
with requests.get(frame_annotation_path, stream=True) as r:
|
276 |
r.raise_for_status()
|
@@ -284,8 +286,7 @@ class XDViolence(datasets.GeneratorBasedBuilder):
|
|
284 |
]
|
285 |
|
286 |
id2frame_annotation[id] = frame_annotation
|
287 |
-
|
288 |
-
frame_annotation_path = r.text
|
289 |
else:
|
290 |
with open(frame_annotation_path, "r") as f:
|
291 |
for line in f:
|
|
|
266 |
)
|
267 |
|
268 |
if frame_annotation_path: # test set
|
|
|
269 |
id2frame_annotation = {}
|
270 |
+
print(frame_annotation_path)
|
271 |
+
print(id2frame_annotation)
|
272 |
|
273 |
url_components = urllib.parse.urlparse(frame_annotation_path)
|
274 |
is_url = url_components.scheme in ("http", "https")
|
275 |
+
print(f"{is_url=}")
|
276 |
if is_url:
|
277 |
with requests.get(frame_annotation_path, stream=True) as r:
|
278 |
r.raise_for_status()
|
|
|
286 |
]
|
287 |
|
288 |
id2frame_annotation[id] = frame_annotation
|
289 |
+
|
|
|
290 |
else:
|
291 |
with open(frame_annotation_path, "r") as f:
|
292 |
for line in f:
|