Spaces:
Runtime error
Runtime error
cybernatedArt
commited on
Commit
•
f914b82
1
Parent(s):
f0dc866
Update app.py
Browse files
app.py
CHANGED
@@ -5,16 +5,9 @@ import requests
|
|
5 |
from tensorflow.keras.applications.resnet50 import ResNet50
|
6 |
from tensorflow.keras.applications.resnet50 import preprocess_input
|
7 |
from tensorflow.keras.models import load_model
|
8 |
-
from transformers import pipeline
|
9 |
-
|
10 |
|
11 |
model = tf.keras.models.load_model('model_2.h5')
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
pipe = pipeline(task="image-classification",
|
16 |
-
# model for 22k-category classification
|
17 |
-
model)
|
18 |
#function
|
19 |
def example(image):
|
20 |
image = image.reshape(-1, 256, 256, 3)
|
@@ -55,4 +48,4 @@ gr.Interface( example,inputs = image,outputs = label,capture_session = True,
|
|
55 |
title=title,
|
56 |
description= description,
|
57 |
examples = examples
|
58 |
-
).launch(share=True)
|
|
|
5 |
from tensorflow.keras.applications.resnet50 import ResNet50
|
6 |
from tensorflow.keras.applications.resnet50 import preprocess_input
|
7 |
from tensorflow.keras.models import load_model
|
|
|
|
|
8 |
|
9 |
model = tf.keras.models.load_model('model_2.h5')
|
10 |
|
|
|
|
|
|
|
|
|
|
|
11 |
#function
|
12 |
def example(image):
|
13 |
image = image.reshape(-1, 256, 256, 3)
|
|
|
48 |
title=title,
|
49 |
description= description,
|
50 |
examples = examples
|
51 |
+
).launch(share=True,inbrowser=True)
|