Skip to content

Instantly share code, notes, and snippets.

View chirag-agarwall's full-sized avatar
🎯
Focusing

Chirag Agarwal chirag-agarwall

🎯
Focusing
View GitHub Profile
@chirag-agarwall
chirag-agarwall / imagenet_validation_class_id_net_id_mapper
Created May 3, 2020 23:56
A python loader for mapping ImageNet validation image to their respective class id's and net id's
def image_name_to_netid():
# Map imagenet names to their netids
input_f = open("./imagenet_validation_imagename_labels.txt")
label_map = {}
netid_map = {}
for line in input_f:
parts = line.strip().split(" ")
label_map[parts[0]] = parts[1]
netid_map[parts[0]] = parts[2]
return label_map, netid_map