jumashafara commited on
Commit
16deb46
·
1 Parent(s): bd2a33f

Upload 7 files

Browse files
Tomato___Bacterial_spot.JPG ADDED
Tomato___Early_blight.JPG ADDED
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import timm
2
+ import gradio as gr
3
+ from pathlib import Path
4
+ from fastai.vision.all import *
5
+
6
+ categories = ['Tomato___Bacterial_spot', 'Tomato___Early_blight', 'Tomato___Late_blight', 'Tomato___Leaf_Mold', 'Tomato___Septoria_leaf_spot', 'Tomato___Spider_mites Two-spotted_spider_mite', 'Tomato___Target_Spot', 'Tomato___Tomato_Yellow_Leaf_Curl_Virus', 'Tomato___Tomato_mosaic_virus', 'Tomato___healthy']
7
+
8
+ learner = load_learner(Path('tomato_resnet50.pkl'))
9
+
10
+ def classify(img):
11
+ category, index, probs = learner.predict(img)
12
+ return (dict(zip(categories, map(float, probs))))
13
+
14
+ image = gr.inputs.Image(shape=(224))
15
+ label = gr.outputs.Label()
16
+ example = ['Tomato___Bacterial_spot', 'Tomato___Early_blight']
17
+
18
+ interface = gr.Interface(fn=classify,
19
+ inputs='image',
20
+ outputs='label',
21
+ example=example)
22
+
23
+ interface.launch()
pyvenv.cfg ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ home = C:\Users\PANOBOOKING\AppData\Local\Programs\Python\Python310
2
+ include-system-site-packages = false
3
+ version = 3.10.11
requirements.txt ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiofiles==23.1.0
2
+ aiohttp==3.8.4
3
+ aiosignal==1.3.1
4
+ altair==5.0.1
5
+ anyio==3.7.0
6
+ async-timeout==4.0.2
7
+ attrs==23.1.0
8
+ blis==0.7.9
9
+ catalogue==2.0.8
10
+ certifi==2023.5.7
11
+ charset-normalizer==3.1.0
12
+ click==8.1.3
13
+ colorama==0.4.6
14
+ confection==0.0.4
15
+ contourpy==1.1.0
16
+ cycler==0.11.0
17
+ cymem==2.0.7
18
+ exceptiongroup==1.1.1
19
+ fastai==2.7.12
20
+ fastapi==0.97.0
21
+ fastcore==1.5.29
22
+ fastdownload==0.0.7
23
+ fastprogress==1.0.3
24
+ ffmpy==0.3.0
25
+ filelock==3.12.2
26
+ fonttools==4.40.0
27
+ frozenlist==1.3.3
28
+ fsspec==2023.6.0
29
+ gradio==3.35.2
30
+ gradio_client==0.2.7
31
+ h11==0.14.0
32
+ httpcore==0.17.2
33
+ httpx==0.24.1
34
+ huggingface-hub==0.15.1
35
+ idna==3.4
36
+ Jinja2==3.1.2
37
+ joblib==1.2.0
38
+ jsonschema==4.17.3
39
+ kiwisolver==1.4.4
40
+ langcodes==3.3.0
41
+ linkify-it-py==2.0.2
42
+ markdown-it-py==2.2.0
43
+ MarkupSafe==2.1.3
44
+ matplotlib==3.7.1
45
+ mdit-py-plugins==0.3.3
46
+ mdurl==0.1.2
47
+ mpmath==1.3.0
48
+ multidict==6.0.4
49
+ murmurhash==1.0.9
50
+ networkx==3.1
51
+ numpy==1.25.0
52
+ orjson==3.9.1
53
+ packaging==23.1
54
+ pandas==2.0.2
55
+ pathy==0.10.2
56
+ Pillow==9.5.0
57
+ preshed==3.0.8
58
+ pydantic==1.10.9
59
+ pydub==0.25.1
60
+ Pygments==2.15.1
61
+ pyparsing==3.1.0
62
+ pyrsistent==0.19.3
63
+ python-dateutil==2.8.2
64
+ python-multipart==0.0.6
65
+ pytz==2023.3
66
+ PyYAML==6.0
67
+ requests==2.31.0
68
+ safetensors==0.3.1
69
+ scikit-learn==1.2.2
70
+ scipy==1.10.1
71
+ semantic-version==2.10.0
72
+ six==1.16.0
73
+ smart-open==6.3.0
74
+ sniffio==1.3.0
75
+ spacy==3.5.3
76
+ spacy-legacy==3.0.12
77
+ spacy-loggers==1.0.4
78
+ srsly==2.4.6
79
+ starlette==0.27.0
80
+ sympy==1.12
81
+ thinc==8.1.10
82
+ threadpoolctl==3.1.0
83
+ timm==0.9.2
84
+ toolz==0.12.0
85
+ torch==2.0.1
86
+ torchvision==0.15.2
87
+ tqdm==4.65.0
88
+ typer==0.7.0
89
+ typing_extensions==4.6.3
90
+ tzdata==2023.3
91
+ uc-micro-py==1.0.2
92
+ urllib3==2.0.3
93
+ uvicorn==0.22.0
94
+ wasabi==1.1.2
95
+ websockets==11.0.3
96
+ yarl==1.9.2
tomato_resnet50.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1af72d9d37f3a63ad5ba0a736bdb46f24fca9ff0a8905cfe898f550f3008d4a9
3
+ size 103204843