zachwormgoor@gmail.com
commited on
Commit
•
91cc7ac
1
Parent(s):
0917cd6
more sample images for testing
Browse files- amateur-easy.jpg +0 -0
- amateur-easy2.jpg +0 -0
- app.py +5 -2
- stock-easy.jpg +0 -0
- stock-easy2.jpg +0 -0
amateur-easy.jpg
ADDED
![]() |
amateur-easy2.jpg
ADDED
![]() |
app.py
CHANGED
@@ -45,7 +45,10 @@ import gradio as gr
|
|
45 |
# model created from: https://www.kaggle.com/code/zachwormgoor/stock-photo-recognizer
|
46 |
learn = load_learner('model.pkl')
|
47 |
|
48 |
-
categories = ('
|
|
|
|
|
|
|
49 |
|
50 |
def classify_image(img):
|
51 |
pred,idx,probs = learn.predict(img)
|
@@ -54,7 +57,7 @@ def classify_image(img):
|
|
54 |
|
55 |
image = gr.inputs.Image(shape=(192, 192))
|
56 |
label = gr.outputs.Label()
|
57 |
-
examples = ['stock.jpg', 'amateur.jpg', 'unsure.jpg']
|
58 |
# stock: https://image.shutterstock.com/image-photo/industrial-interior-storage-tank-rusty-260nw-132762554.jpg
|
59 |
# amateur: https://cimg3.ibsrv.net/cimg/www.honda-tech.com/1024x768_85/479/AAApril-2-Control-Arms-01-58479.jpg
|
60 |
# unsure: https://en.wikipedia.org/wiki/Joshua_Bean
|
|
|
45 |
# model created from: https://www.kaggle.com/code/zachwormgoor/stock-photo-recognizer
|
46 |
learn = load_learner('model.pkl')
|
47 |
|
48 |
+
categories = ('amateur', 'stock')
|
49 |
+
|
50 |
+
#may have categories swapped?
|
51 |
+
#add probs to UI somewhere
|
52 |
|
53 |
def classify_image(img):
|
54 |
pred,idx,probs = learn.predict(img)
|
|
|
57 |
|
58 |
image = gr.inputs.Image(shape=(192, 192))
|
59 |
label = gr.outputs.Label()
|
60 |
+
examples = ['stock.jpg', 'stock-easy.jpg', 'stock-easy2.jpg', 'amateur.jpg', 'amateur-easy.jpg', 'amateur-easy2.jpg', 'unsure.jpg']
|
61 |
# stock: https://image.shutterstock.com/image-photo/industrial-interior-storage-tank-rusty-260nw-132762554.jpg
|
62 |
# amateur: https://cimg3.ibsrv.net/cimg/www.honda-tech.com/1024x768_85/479/AAApril-2-Control-Arms-01-58479.jpg
|
63 |
# unsure: https://en.wikipedia.org/wiki/Joshua_Bean
|
stock-easy.jpg
ADDED
![]() |
stock-easy2.jpg
ADDED
![]() |