Update Action-Effect.py
Browse files- Action-Effect.py +2 -6
Action-Effect.py
CHANGED
|
@@ -1,10 +1,8 @@
|
|
| 1 |
import json
|
| 2 |
-
from zipfile import ZipFile
|
| 3 |
import datasets
|
| 4 |
import os
|
| 5 |
from PIL import Image
|
| 6 |
from numpy import asarray
|
| 7 |
-
import tarfile
|
| 8 |
|
| 9 |
_CITATION = """\
|
| 10 |
@inproceedings{gao-etal-2018-action,
|
|
@@ -74,10 +72,8 @@ class Action_Effect(datasets.GeneratorBasedBuilder):
|
|
| 74 |
def _generate_examples(self, action_effect_info_path, img_zip_path):
|
| 75 |
with open(action_effect_info_path) as f:
|
| 76 |
action_effect_info = json.load(f)
|
| 77 |
-
img_zip = tarfile.open(img_zip_path)
|
| 78 |
-
|
| 79 |
-
img_root = "./action_effect_image_rs/"
|
| 80 |
-
img_zip.close()
|
| 81 |
for idx, this_ae_info in enumerate(action_effect_info):
|
| 82 |
this_ae_info['positive_image_list'] = []
|
| 83 |
this_ae_info['negative_image_list'] = []
|
|
|
|
| 1 |
import json
|
|
|
|
| 2 |
import datasets
|
| 3 |
import os
|
| 4 |
from PIL import Image
|
| 5 |
from numpy import asarray
|
|
|
|
| 6 |
|
| 7 |
_CITATION = """\
|
| 8 |
@inproceedings{gao-etal-2018-action,
|
|
|
|
| 72 |
def _generate_examples(self, action_effect_info_path, img_zip_path):
|
| 73 |
with open(action_effect_info_path) as f:
|
| 74 |
action_effect_info = json.load(f)
|
| 75 |
+
# img_zip = tarfile.open(img_zip_path)
|
| 76 |
+
img_root = img_zip_path+ "/action_effect_image_rs/"
|
|
|
|
|
|
|
| 77 |
for idx, this_ae_info in enumerate(action_effect_info):
|
| 78 |
this_ae_info['positive_image_list'] = []
|
| 79 |
this_ae_info['negative_image_list'] = []
|