Files changed (3) hide show
  1. app.py +20 -9
  2. gitattributes +37 -0
  3. requirements.txt +123 -1
app.py CHANGED
@@ -1,19 +1,30 @@
1
  import gradio as gr
2
- from fastai.vision.all import *
 
 
 
 
3
 
4
  learn = load_learner('export.pkl')
5
 
6
  labels = learn.dls.vocab
7
 
8
  def predict(img):
9
- img = PILImage.create(img)
10
- pred,pred_idx,probs = learn.predict(img)
11
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
12
 
13
- title = "Soybean desease Classifier"
14
- description = "A Soybean desease classifier trained with "
15
- article="<p style='text-align: center'><a href='https://www.kaggle.com/lucaskishima/soybeandeseaseclassifier/' target='_blank'>Blog post</a></p>"
16
- interpretation='default'
17
- enable_queue=True
18
 
19
- gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(512, 512)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,article=article,interpretation=interpretation,enable_queue=enable_queue).launch(share=False)
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from fastai.learner import load_learner
3
+ from fastai.vision.all import *
4
+ from gradio.components import Image, Label # Use Label para o output
5
+
6
+ # ... (restante do seu código)
7
 
8
  learn = load_learner('export.pkl')
9
 
10
  labels = learn.dls.vocab
11
 
12
  def predict(img):
13
+ img = PILImage.create(img)
14
+ pred, pred_idx, probs = learn.predict(img)
15
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
16
 
17
+ title = "Agromarkers Classificador de Doença da Soja"
18
+ description = "Uma classificador de doenças treinado por IA "
19
+ article="<p style='text-align: center'><a href='https://www.agromarkers.com.br' target='_blank'>Home - Agromarkers</a></p>"
20
+
21
+ output = Label(num_top_classes=3)
22
 
23
+ gr.Interface(
24
+ fn=predict,
25
+ inputs=Image(type="pil", image_mode="RGB"),
26
+ outputs=output, # Use Label para a saída
27
+ title=title,
28
+ description=description,
29
+ article=article
30
+ ).launch(share=False)
gitattributes ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ examples/bacterial_blight.jpg filter=lfs diff=lfs merge=lfs -text
36
+ examples/healthy.jpg filter=lfs diff=lfs merge=lfs -text
37
+ examples/soybean_rust.jpg filter=lfs diff=lfs merge=lfs -text
requirements.txt CHANGED
@@ -1 +1,123 @@
1
- fastai
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiofiles==23.2.1
2
+ altair==5.4.0
3
+ annotated-types==0.7.0
4
+ anyio==4.4.0
5
+ attrs==24.2.0
6
+ blinker==1.8.2
7
+ blis==0.7.11
8
+ cachetools==5.5.0
9
+ catalogue==2.0.10
10
+ certifi==2024.7.4
11
+ charset-normalizer==3.3.2
12
+ click==8.1.7
13
+ cloudpathlib==0.18.1
14
+ confection==0.1.5
15
+ contourpy==1.2.1
16
+ cycler==0.12.1
17
+ cymem==2.0.8
18
+ fastai==2.7.16
19
+ fastapi==0.112.1
20
+ fastcore==1.5.55
21
+ fastdownload==0.0.7
22
+ fastprogress==1.0.3
23
+ ffmpy==0.4.0
24
+ filelock==3.15.4
25
+ fonttools==4.53.1
26
+ fsspec==2024.6.1
27
+ gitdb==4.0.11
28
+ GitPython==3.1.43
29
+ gradio==4.42.0
30
+ gradio_client==1.3.0
31
+ h11==0.14.0
32
+ httpcore==1.0.5
33
+ httpx==0.27.0
34
+ huggingface-hub==0.24.6
35
+ idna==3.7
36
+ importlib_resources==6.4.4
37
+ Jinja2==3.1.4
38
+ joblib==1.4.2
39
+ jsonschema==4.23.0
40
+ jsonschema-specifications==2023.12.1
41
+ kiwisolver==1.4.5
42
+ langcodes==3.4.0
43
+ language_data==1.2.0
44
+ marisa-trie==1.2.0
45
+ markdown-it-py==3.0.0
46
+ MarkupSafe==2.1.5
47
+ matplotlib==3.9.2
48
+ mdurl==0.1.2
49
+ mpmath==1.3.0
50
+ murmurhash==1.0.10
51
+ narwhals==1.5.2
52
+ networkx==3.3
53
+ numpy==1.26.4
54
+ nvidia-cublas-cu12==12.1.3.1
55
+ nvidia-cuda-cupti-cu12==12.1.105
56
+ nvidia-cuda-nvrtc-cu12==12.1.105
57
+ nvidia-cuda-runtime-cu12==12.1.105
58
+ nvidia-cudnn-cu12==9.1.0.70
59
+ nvidia-cufft-cu12==11.0.2.54
60
+ nvidia-curand-cu12==10.3.2.106
61
+ nvidia-cusolver-cu12==11.4.5.107
62
+ nvidia-cusparse-cu12==12.1.0.106
63
+ nvidia-nccl-cu12==2.20.5
64
+ nvidia-nvjitlink-cu12==12.6.20
65
+ nvidia-nvtx-cu12==12.1.105
66
+ orjson==3.10.7
67
+ packaging==24.1
68
+ pandas==2.2.2
69
+ pillow==10.4.0
70
+ preshed==3.0.9
71
+ protobuf==5.27.3
72
+ pyarrow==17.0.0
73
+ pydantic==2.8.2
74
+ pydantic_core==2.20.1
75
+ pydeck==0.9.1
76
+ pydub==0.25.1
77
+ Pygments==2.18.0
78
+ pyparsing==3.1.2
79
+ python-dateutil==2.9.0.post0
80
+ python-multipart==0.0.9
81
+ pytz==2024.1
82
+ PyYAML==6.0.2
83
+ referencing==0.35.1
84
+ requests==2.32.3
85
+ rich==13.7.1
86
+ rpds-py==0.20.0
87
+ ruff==0.6.2
88
+ scikit-learn==1.5.1
89
+ scipy==1.14.1
90
+ semantic-version==2.10.0
91
+ setuptools==73.0.1
92
+ shellingham==1.5.4
93
+ six==1.16.0
94
+ smart-open==7.0.4
95
+ smmap==5.0.1
96
+ sniffio==1.3.1
97
+ spacy==3.7.6
98
+ spacy-legacy==3.0.12
99
+ spacy-loggers==1.0.5
100
+ srsly==2.4.8
101
+ starlette==0.38.2
102
+ streamlit==1.37.1
103
+ sympy==1.13.2
104
+ tenacity==8.5.0
105
+ thinc==8.2.5
106
+ threadpoolctl==3.5.0
107
+ toml==0.10.2
108
+ tomlkit==0.12.0
109
+ torch==2.4.0
110
+ torchvision==0.19.0
111
+ tornado==6.4.1
112
+ tqdm==4.66.5
113
+ triton==3.0.0
114
+ typer==0.12.4
115
+ typing_extensions==4.12.2
116
+ tzdata==2024.1
117
+ urllib3==2.2.2
118
+ uvicorn==0.30.6
119
+ wasabi==1.1.3
120
+ watchdog==4.0.2
121
+ weasel==0.4.1
122
+ websockets==12.0
123
+ wrapt==1.16.0