Spaces:
Runtime error
Runtime error
Added a title, description, and example
Browse files- app.py +22 -5
- cyberfrog-2992.png +0 -0
- gogonaut-670.png +0 -0
- mad-lad-6119.png +0 -0
- smb-gen2-4827.png +0 -0
- smb-gen2-green-hat.png +0 -0
- smb-gen2-logo.png +0 -0
- smb-gen3-1728.png +0 -0
- smb-gen3-5544.png +0 -0
- smb-gen3-6123.png +0 -0
app.py
CHANGED
|
@@ -64,11 +64,28 @@ def classify_image(img):
|
|
| 64 |
pred, idx, probs = smb_model.predict(img)
|
| 65 |
return {smb_model.dls.vocab[i]: float(p) for i, p in enumerate(probs)}
|
| 66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
interface = gr.Interface(
|
| 68 |
fn=classify_image,
|
| 69 |
-
inputs=gr.Image(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
outputs=gr.Label(num_top_classes=3),
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
| 64 |
pred, idx, probs = smb_model.predict(img)
|
| 65 |
return {smb_model.dls.vocab[i]: float(p) for i, p in enumerate(probs)}
|
| 66 |
|
| 67 |
+
title = "SMB Collection Identifier"
|
| 68 |
+
description = "An NFT Identifier that determines whether or not an images belong to the SMB Gen 2 or Gen 3 Collection."
|
| 69 |
+
|
| 70 |
+
smb_gen2_examples = ["smb-gen2-green-hat.png", "smb-gen2-4827.png", "smb-gen2-logo.png"]
|
| 71 |
+
smb_gen3_examples = ["smb-gen3-6123.png", "smb-gen3-5544.png", "smb-gen3-1728.png"]
|
| 72 |
+
neither_examples = ["cyberfrog-2992.png", "mad-lad-6119.png", "gognaut-670.png"]
|
| 73 |
+
|
| 74 |
+
examples = smb_gen2_examples + smb_gen3_examples + neither_examples
|
| 75 |
+
|
| 76 |
+
example_labels = ['SMB Gen 2'] * len(smb_gen2_examples) + ['SMB Gen 3'] * len(smb_gen3_examples) + ['Neither'] * len(neither_examples)
|
| 77 |
+
|
| 78 |
interface = gr.Interface(
|
| 79 |
fn=classify_image,
|
| 80 |
+
inputs=gr.Image(
|
| 81 |
+
type='pil',
|
| 82 |
+
height=512,
|
| 83 |
+
width=512,
|
| 84 |
+
label="Upload Image or take a photo"
|
| 85 |
+
),
|
| 86 |
outputs=gr.Label(num_top_classes=3),
|
| 87 |
+
title=title,
|
| 88 |
+
description=description,
|
| 89 |
+
examples=examples,
|
| 90 |
+
example_labels=example_labels
|
| 91 |
+
)
|
cyberfrog-2992.png
ADDED
|
gogonaut-670.png
ADDED
|
mad-lad-6119.png
ADDED
|
smb-gen2-4827.png
ADDED
|
smb-gen2-green-hat.png
ADDED
|
smb-gen2-logo.png
ADDED
|
smb-gen3-1728.png
ADDED
|
smb-gen3-5544.png
ADDED
|
smb-gen3-6123.png
ADDED
|