Spaces:
Runtime error
Runtime error
Commit
·
3104922
1
Parent(s):
f4f30ca
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ article = """
|
|
| 18 |
</p>
|
| 19 |
"""
|
| 20 |
|
| 21 |
-
def
|
| 22 |
random_latent_vectors = tf.random.normal(shape=(int(num_images), 128))
|
| 23 |
predictions = model(random_latent_vectors)
|
| 24 |
num = ceil(sqrt(num_images))
|
|
@@ -33,14 +33,14 @@ def create_digit_samples(model, num_images):
|
|
| 33 |
return images
|
| 34 |
|
| 35 |
def inference(num_images, select: str):
|
| 36 |
-
if select == '
|
| 37 |
-
result =
|
| 38 |
else:
|
| 39 |
-
result =
|
| 40 |
return result
|
| 41 |
|
| 42 |
-
inputs = [gr.inputs.Number(label="number of images"), gr.inputs.Radio(['
|
| 43 |
outputs = gr.outputs.Image(label="Output Image")
|
| 44 |
|
| 45 |
|
| 46 |
-
gr.Interface(inference, inputs, outputs, analytics_enabled=False).launch(share=True)
|
|
|
|
| 18 |
</p>
|
| 19 |
"""
|
| 20 |
|
| 21 |
+
def Predict(model, num_images):
|
| 22 |
random_latent_vectors = tf.random.normal(shape=(int(num_images), 128))
|
| 23 |
predictions = model(random_latent_vectors)
|
| 24 |
num = ceil(sqrt(num_images))
|
|
|
|
| 33 |
return images
|
| 34 |
|
| 35 |
def inference(num_images, select: str):
|
| 36 |
+
if select == 'Fashion_mnist':
|
| 37 |
+
result = Predict(model2, num_images)
|
| 38 |
else:
|
| 39 |
+
result = Predict(model1, num_images)
|
| 40 |
return result
|
| 41 |
|
| 42 |
+
inputs = [gr.inputs.Number(label="number of images"), gr.inputs.Radio(['Fashion_mnist', 'Handwritten_digits_mnist'])]
|
| 43 |
outputs = gr.outputs.Image(label="Output Image")
|
| 44 |
|
| 45 |
|
| 46 |
+
gr.Interface(inference, inputs, outputs, title=title, description=description, article=article, analytics_enabled=False).launch(share=True)
|