Spaces:
Running
Running
Removed random.seed error
Browse files- tab_manager.py +4 -4
tab_manager.py
CHANGED
@@ -448,7 +448,7 @@ def update_images_tab(imagesTab):
|
|
448 |
for idx, image in enumerate(user_evaluation_variables.OBJECT_IMAGES):
|
449 |
next(cols).image(image, width=225, caption=user_evaluation_variables.OBJECT_CAPTIONS[1][idx])
|
450 |
|
451 |
-
zipPath = 'TBYB_' + user_evaluation_variables.
|
452 |
download_and_zip_images(zipPath, user_evaluation_variables.OBJECT_IMAGES,
|
453 |
user_evaluation_variables.OBJECT_CAPTIONS, 'object')
|
454 |
|
@@ -470,7 +470,7 @@ def update_images_tab(imagesTab):
|
|
470 |
for idx, image in enumerate(user_evaluation_variables.OCCUPATION_IMAGES):
|
471 |
next(cols).image(image, width=225, caption=user_evaluation_variables.OCCUPATION_CAPTIONS[1][idx])
|
472 |
|
473 |
-
zipPath = 'TBYB_' + user_evaluation_variables.
|
474 |
|
475 |
download_and_zip_images(zipPath, user_evaluation_variables.OCCUPATION_IMAGES,
|
476 |
user_evaluation_variables.OCCUPATION_CAPTIONS, 'occupation')
|
@@ -493,7 +493,7 @@ def update_images_tab(imagesTab):
|
|
493 |
for idx, image in enumerate(user_evaluation_variables.TASK_IMAGES):
|
494 |
next(cols).image(image, width=225, caption=user_evaluation_variables.TASK_CAPTIONS[1][idx])
|
495 |
|
496 |
-
zipPath = 'TBYB_' + user_evaluation_variables.
|
497 |
download_and_zip_images(zipPath, user_evaluation_variables.TASK_IMAGES,
|
498 |
user_evaluation_variables.TASK_CAPTIONS, 'task-oriented')
|
499 |
|
@@ -502,7 +502,7 @@ def get_COCO_captions(filePath, target, progressBar, NPrompts=50):
|
|
502 |
captionData = json.load(open(filePath))
|
503 |
COCOCaptions = []
|
504 |
COCOIDs = []
|
505 |
-
random.seed(42)
|
506 |
random.shuffle(captionData['annotations'])
|
507 |
for anno, pp in zip(captionData['annotations'], range(len(captionData['annotations']))):
|
508 |
if target in anno.get('caption').lower().split(' '):
|
|
|
448 |
for idx, image in enumerate(user_evaluation_variables.OBJECT_IMAGES):
|
449 |
next(cols).image(image, width=225, caption=user_evaluation_variables.OBJECT_CAPTIONS[1][idx])
|
450 |
|
451 |
+
zipPath = 'TBYB_' + user_evaluation_variables.EVAL_ID + '_' + user_evaluation_variables.DATE + '_' + user_evaluation_variables.TIME + '_object_related_images.zip'
|
452 |
download_and_zip_images(zipPath, user_evaluation_variables.OBJECT_IMAGES,
|
453 |
user_evaluation_variables.OBJECT_CAPTIONS, 'object')
|
454 |
|
|
|
470 |
for idx, image in enumerate(user_evaluation_variables.OCCUPATION_IMAGES):
|
471 |
next(cols).image(image, width=225, caption=user_evaluation_variables.OCCUPATION_CAPTIONS[1][idx])
|
472 |
|
473 |
+
zipPath = 'TBYB_' + user_evaluation_variables.EVAL_ID + '_' + user_evaluation_variables.DATE + '_' + user_evaluation_variables.TIME + '_occupation_related_images.zip'
|
474 |
|
475 |
download_and_zip_images(zipPath, user_evaluation_variables.OCCUPATION_IMAGES,
|
476 |
user_evaluation_variables.OCCUPATION_CAPTIONS, 'occupation')
|
|
|
493 |
for idx, image in enumerate(user_evaluation_variables.TASK_IMAGES):
|
494 |
next(cols).image(image, width=225, caption=user_evaluation_variables.TASK_CAPTIONS[1][idx])
|
495 |
|
496 |
+
zipPath = 'TBYB_' + user_evaluation_variables.EVAL_ID + '_' + user_evaluation_variables.DATE + '_' + user_evaluation_variables.TIME + '_' + user_evaluation_variables.TASK_TARGET + '_related_images.zip'
|
497 |
download_and_zip_images(zipPath, user_evaluation_variables.TASK_IMAGES,
|
498 |
user_evaluation_variables.TASK_CAPTIONS, 'task-oriented')
|
499 |
|
|
|
502 |
captionData = json.load(open(filePath))
|
503 |
COCOCaptions = []
|
504 |
COCOIDs = []
|
505 |
+
# random.seed(42)
|
506 |
random.shuffle(captionData['annotations'])
|
507 |
for anno, pp in zip(captionData['annotations'], range(len(captionData['annotations']))):
|
508 |
if target in anno.get('caption').lower().split(' '):
|