Spaces:
Runtime error
Runtime error
Commit
·
e828d81
1
Parent(s):
984367f
Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,8 @@ from huggingface_hub import from_pretrained_fastai
|
|
4 |
|
5 |
learn = from_pretrained_fastai('mindwrapped/pokemon-card-checker')
|
6 |
|
7 |
-
def check_card(
|
8 |
-
pred_label, _, scores = learn.predict(
|
9 |
scores = scores.detach().numpy()
|
10 |
return {'real': float(scores[1]), 'fake': float(scores[0])}
|
11 |
|
@@ -19,7 +19,6 @@ demo = gr.Interface(
|
|
19 |
description='A resnet34 model fine-tuned to determine whether Pokemon cards are real or fake. \n\n[Dataset](https://www.kaggle.com/datasets/ongshujian/real-and-fake-pokemon-cards) created by [Shujian Ong](https://www.kaggle.com/ongshujian).',
|
20 |
article='Can you guess which cards are real and fake? \n\nI can\'t :D \n\n([View Labels](https://gist.github.com/mindwrapped/e5aad747757ef006037a1a1982be34fc)) \n\n![visitor badge](https://visitor-badge.glitch.me/badge?page_id=mindwrapped.pokemon-card-checker-space)',
|
21 |
live=False,
|
22 |
-
|
23 |
)
|
24 |
|
25 |
demo.launch()
|
|
|
4 |
|
5 |
learn = from_pretrained_fastai('mindwrapped/pokemon-card-checker')
|
6 |
|
7 |
+
def check_card(img):
|
8 |
+
pred_label, _, scores = learn.predict(img)
|
9 |
scores = scores.detach().numpy()
|
10 |
return {'real': float(scores[1]), 'fake': float(scores[0])}
|
11 |
|
|
|
19 |
description='A resnet34 model fine-tuned to determine whether Pokemon cards are real or fake. \n\n[Dataset](https://www.kaggle.com/datasets/ongshujian/real-and-fake-pokemon-cards) created by [Shujian Ong](https://www.kaggle.com/ongshujian).',
|
20 |
article='Can you guess which cards are real and fake? \n\nI can\'t :D \n\n([View Labels](https://gist.github.com/mindwrapped/e5aad747757ef006037a1a1982be34fc)) \n\n![visitor badge](https://visitor-badge.glitch.me/badge?page_id=mindwrapped.pokemon-card-checker-space)',
|
21 |
live=False,
|
|
|
22 |
)
|
23 |
|
24 |
demo.launch()
|