Created
May 28, 2021 08:06
-
-
Save falahgs/0069c19ed50e44056358d2a0727c503c to your computer and use it in GitHub Desktop.
Image Captionng
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open('open_images_train_captions.jsonl', 'r') as json_file: | |
json_list = json_file.read().split('\n') | |
np.random.shuffle(json_list) | |
data = [] | |
N = 100000 | |
for ix, json_str in Tqdm(enumerate(json_list), N): | |
if ix == N: break | |
try: | |
result = json.loads(json_str) | |
x = pd.DataFrame.from_dict(result, orient='index').T | |
data.append(x) | |
except: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
update