mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
add imagenet labels for demo
This commit is contained in:
parent
ff7dee0086
commit
d2b5abf749
1000
demo/files/imagenet_labels.json
Normal file
1000
demo/files/imagenet_labels.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -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()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user