add imagenet labels for demo

This commit is contained in:
Ali Abid 2020-11-02 18:21:31 -08:00
parent ff7dee0086
commit d2b5abf749
2 changed files with 1004 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

@ -7,10 +7,11 @@ import numpy as np
from PIL import Image from PIL import Image
import requests import requests
from urllib.request import urlretrieve from urllib.request import urlretrieve
import json
# # Download human-readable labels for ImageNet. # Load human-readable labels for ImageNet.
response = requests.get("https://git.io/JJkYN") with open("files/imagenet_labels.json") as labels_file:
labels = response.text.split("\n") labels = json.load(labels_file)
mobile_net = tf.keras.applications.MobileNetV2() mobile_net = tf.keras.applications.MobileNetV2()