Skip to content

Commit db638bd

Browse files
committed
update: frontend react
1 parent f8692cc commit db638bd

File tree

5 files changed

+76
-24
lines changed

5 files changed

+76
-24
lines changed

.gcloudignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file specifies files that are *not* uploaded to Google Cloud
2+
# using gcloud. It follows the same syntax as .gitignore, with the addition of
3+
# "#!include" directives (which insert the entries of the given .gitignore-style
4+
# file at that point).
5+
#
6+
# For more information, run:
7+
# $ gcloud topic gcloudignore
8+
#
9+
.gcloudignore
10+
# If you would like to upload your .git directory, .gitignore file or files
11+
# from your .gitignore file, remove the corresponding line
12+
# below:
13+
.git
14+
.gitignore
15+
16+
node_modules
17+
#!include:.gitignore

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Potato Leaf Disease Classification
2+
3+
The goal of this research is to create a convolutional neural network (CNN) that can categorize illnesses of potato leaves. Accurately determining if a potato leaf is healthy, blight-affected early or late is the aim. It consists of a web application for real-time leaf classification and a TensorFlow model trained on the potato leaf disease dataset.
4+
5+
### Project Components
6+
7+
#### Convolutional Neural Network (CNN)
8+
9+
TensorFlow is used in a Jupyter Notebook inside of VSCode to build the CNN model. It learns and divides potato leaf photos into three groups: healthy, early blight, and late blight. It does this by utilizing deep learning algorithms. The notebook contains specifics on the model's construction and training procedure.
10+
11+
#### Web Application
12+
13+
To input photos of potato leaves and get predictions from the trained CNN model, use the web application's intuitive interface. It shows the probability score for each class as well as the expected class (healthy, early blight, or late blight). With this application, users may evaluate the health of potato plants rapidly.
14+
15+
#### Deployment on Google Cloud
16+
17+
For scalability and accessibility, the trained TensorFlow CNN model is hosted on Google Cloud Platform (GCP). Its smooth interaction with the online application is made possible by its storage in a cloud storage bucket. The deployment procedure makes sure that cloud resources are used effectively for jobs involving inference and prediction.
18+
19+
#### API Server
20+
21+
To enable communication between the web application and the TensorFlow model that is installed on GCP, an API server is put into place. This server receives incoming picture requests, runs the CNN model on them, and instantly provides the web application with the classified images. It guarantees the leaf classification system's dependability and seamless operation.
22+
23+
### Technologies Used
24+
- Python
25+
- TensorFlow
26+
- Jupyter Notebook in VS Code
27+
- Fastapi
28+
- HTML/CSS/JavaScript
29+
- Google Cloud Storage
30+
- Google Cloud Platform (GCP)

frontend/package-lock.json

Lines changed: 22 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"web-vitals": "^1.1.2"
1515
},
1616
"scripts": {
17-
"start": "react-scripts start",
17+
"start": "SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
1818
"build": "react-scripts build",
1919
"test": "react-scripts test",
2020
"eject": "react-scripts eject"

frontend/src/js/home.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,14 @@ export const ImageUpload = () => {
154154
formData.append("file", selectedFile);
155155
let res = await axios({
156156
method: "post",
157-
url: process.env.REACT_APP_API_URL,
157+
url: process.env.REACT_APP_CLOUD_URL,
158158
data: formData,
159+
headers: {
160+
"Content-Type": "multipart/form-data",
161+
"Access-Control-Allow-Origin": "*",
162+
},
159163
});
164+
console.log(res.data);
160165
if (res.status === 200) {
161166
setData(res.data);
162167
}

0 commit comments

Comments
 (0)