kahraman kaya commited on
Commit
b46c470
1 Parent(s): 585152a
Files changed (6) hide show
  1. 1.jpg +0 -0
  2. 2.jpg +0 -0
  3. 3.jpg +0 -0
  4. app.py +33 -4
  5. model1.pkl +3 -0
  6. requirements.txt +1 -0
1.jpg ADDED
2.jpg ADDED
3.jpg ADDED
app.py CHANGED
@@ -1,7 +1,36 @@
1
  import gradio as gr
 
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from fastai.vision.all import *
3
+ from fastcore.all import *
4
 
5
+ learn = load_learner("model1.pkl")
 
6
 
7
+ categories = ('Simmental','Holstein',"Hereford","Angus","Charolais","Limousin","Jersey","Brown Swiss")
8
+
9
+ def classify_img(img):
10
+ pred,idx,probs = learn.predict(img)
11
+ return dict(zip(categories, map(float,probs)))
12
+
13
+ with gr.Blocks(title = "ineğin türü nedir? ") as demo:
14
+ with gr.Row():
15
+ gr.Markdown("""
16
+ ## inek türü Tespiti
17
+ #### Bilgisayarınızdan yada telefonunuzdan resim yükleyin
18
+ #### Denemek amaçlı örneklere çift tıklayın ve Tahmin Et tuşuna basın
19
+ """)
20
+ with gr.Row():
21
+ image = gr.inputs.Image(shape=(192,192))
22
+ with gr.Row():
23
+ output = gr.outputs.Label()
24
+ with gr.Row():
25
+ image_button = gr.Button("Tahmin Et")
26
+ image_button.click(classify_img, inputs=image, outputs=output)
27
+
28
+ with gr.Row():
29
+ with gr.Column():
30
+ gr.Examples(inputs=image,examples=["1.jpg"],label="angus")
31
+ with gr.Column():
32
+ gr.Examples(inputs=image,examples=["2.jpg"],label="jersey")
33
+ with gr.Column():
34
+ gr.Examples(inputs=image,examples=["3.jpg"],label="simmental")
35
+
36
+ demo.launch()
model1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44219f03e5f9729494839f5e3b20d49de3f4360441e6e5ff4c49b3afbf72de0e
3
+ size 46970543
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ fastai