Spaces:
Runtime error
Runtime error
davidlee1102
commited on
Commit
·
0982905
1
Parent(s):
12d2ceb
First upload - No model
Browse files- .idea/.gitignore +8 -0
- .idea/diabetes_grading_surreyaml_2023.iml +8 -0
- .idea/inspectionProfiles/profiles_settings.xml +6 -0
- .idea/misc.xml +4 -0
- .idea/modules.xml +8 -0
- .idea/vcs.xml +6 -0
- app.py +41 -0
- requirements.txt +122 -0
.idea/.gitignore
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Default ignored files
|
2 |
+
/shelf/
|
3 |
+
/workspace.xml
|
4 |
+
# Editor-based HTTP Client requests
|
5 |
+
/httpRequests/
|
6 |
+
# Datasource local storage ignored files
|
7 |
+
/dataSources/
|
8 |
+
/dataSources.local.xml
|
.idea/diabetes_grading_surreyaml_2023.iml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<module type="PYTHON_MODULE" version="4">
|
3 |
+
<component name="NewModuleRootManager">
|
4 |
+
<content url="file://$MODULE_DIR$" />
|
5 |
+
<orderEntry type="jdk" jdkName="Python 3.10 (diabetes_grading_surreyaml_2023)" jdkType="Python SDK" />
|
6 |
+
<orderEntry type="sourceFolder" forTests="false" />
|
7 |
+
</component>
|
8 |
+
</module>
|
.idea/inspectionProfiles/profiles_settings.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<component name="InspectionProjectProfileManager">
|
2 |
+
<settings>
|
3 |
+
<option name="USE_PROJECT_PROFILE" value="false" />
|
4 |
+
<version value="1.0" />
|
5 |
+
</settings>
|
6 |
+
</component>
|
.idea/misc.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (diabetes_grading_surreyaml_2023)" project-jdk-type="Python SDK" />
|
4 |
+
</project>
|
.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="ProjectModuleManager">
|
4 |
+
<modules>
|
5 |
+
<module fileurl="file://$PROJECT_DIR$/.idea/diabetes_grading_surreyaml_2023.iml" filepath="$PROJECT_DIR$/.idea/diabetes_grading_surreyaml_2023.iml" />
|
6 |
+
</modules>
|
7 |
+
</component>
|
8 |
+
</project>
|
.idea/vcs.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="VcsDirectoryMappings">
|
4 |
+
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
5 |
+
</component>
|
6 |
+
</project>
|
app.py
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
import streamlit as st
|
3 |
+
import tensorflow as tf
|
4 |
+
|
5 |
+
from PIL import Image
|
6 |
+
|
7 |
+
LABELS = [0, 1, 2, 3, 4]
|
8 |
+
|
9 |
+
st.title("Surrey 2023 - Diabetes Grading")
|
10 |
+
|
11 |
+
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
|
12 |
+
|
13 |
+
|
14 |
+
# Load your TensorFlow model
|
15 |
+
# model = tf.keras.models.load_model("model.h5")
|
16 |
+
|
17 |
+
|
18 |
+
def preprocess_image(image, target_size=(224, 224)):
|
19 |
+
image = image.resize(target_size)
|
20 |
+
image_array = np.array(image) / 255.0
|
21 |
+
return np.expand_dims(image_array, axis=0)
|
22 |
+
|
23 |
+
|
24 |
+
col1, col2 = st.columns(2)
|
25 |
+
|
26 |
+
if uploaded_file is not None:
|
27 |
+
image = Image.open(uploaded_file)
|
28 |
+
col1.image(image, caption="Uploaded Image", use_column_width=True)
|
29 |
+
|
30 |
+
if st.button("Classify"):
|
31 |
+
preprocessed_image = preprocess_image(image)
|
32 |
+
# predictions = model.predict(preprocessed_image)
|
33 |
+
# top_prediction = np.argmax(predictions[0])
|
34 |
+
|
35 |
+
# class_labels = get_class_labels()
|
36 |
+
# predicted_class = class_labels[top_prediction]
|
37 |
+
|
38 |
+
col2.write(f"Predicted class: ") # {predicted_class}
|
39 |
+
else:
|
40 |
+
col1.write("Upload an image to see the classification")
|
41 |
+
col2.write("Prediction will appear here")
|
requirements.txt
ADDED
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
absl-py==1.3.0
|
2 |
+
aiohttp==3.8.3
|
3 |
+
aiosignal==1.2.0
|
4 |
+
altair
|
5 |
+
appdirs==1.4.4
|
6 |
+
appnope==0.1.2
|
7 |
+
asttokens==2.0.5
|
8 |
+
astunparse==1.6.3
|
9 |
+
async-timeout==4.0.2
|
10 |
+
attrs==22.1.0
|
11 |
+
backcall==0.2.0
|
12 |
+
blinker==1.4
|
13 |
+
Bottleneck
|
14 |
+
brotlipy==0.7.0
|
15 |
+
cachetools==4.2.2
|
16 |
+
certifi==2022.12.7
|
17 |
+
cffi==1.15.1
|
18 |
+
charset-normalizer==2.0.4
|
19 |
+
click==8.0.4
|
20 |
+
comm==0.1.2
|
21 |
+
commonmark==0.9.1
|
22 |
+
cryptography==39.0.1
|
23 |
+
debugpy==1.5.1
|
24 |
+
decorator==5.1.1
|
25 |
+
entrypoints==0.4
|
26 |
+
executing==0.8.3
|
27 |
+
flatbuffers==2.0
|
28 |
+
frozenlist==1.3.3
|
29 |
+
future==0.18.3
|
30 |
+
gast==0.4.0
|
31 |
+
gitdb==4.0.7
|
32 |
+
GitPython==3.1.30
|
33 |
+
google-auth==2.6.0
|
34 |
+
google-auth-oauthlib==0.4.4
|
35 |
+
google-pasta==0.2.0
|
36 |
+
grpcio==1.42.0
|
37 |
+
h5py
|
38 |
+
idna==3.4
|
39 |
+
importlib-metadata==6.0.0
|
40 |
+
ipykernel==6.19.2
|
41 |
+
ipython==8.12.0
|
42 |
+
ipywidgets==8.0.4
|
43 |
+
jedi==0.18.1
|
44 |
+
Jinja2==3.1.2
|
45 |
+
jsonschema==4.17.3
|
46 |
+
jupyter_client==8.1.0
|
47 |
+
jupyter_core==5.3.0
|
48 |
+
jupyterlab-widgets==3.0.5
|
49 |
+
keras==2.10.0
|
50 |
+
Keras-Preprocessing
|
51 |
+
Markdown==3.4.1
|
52 |
+
MarkupSafe==2.1.1
|
53 |
+
matplotlib-inline==0.1.6
|
54 |
+
mkl-fft
|
55 |
+
mkl-random==1.2.2
|
56 |
+
mkl-service==2.4.0
|
57 |
+
multidict==6.0.2
|
58 |
+
nest-asyncio==1.5.6
|
59 |
+
numexpr==2.8.4
|
60 |
+
numpy
|
61 |
+
oauthlib==3.2.2
|
62 |
+
opt-einsum==3.3.0
|
63 |
+
packaging==23.0
|
64 |
+
pandas==1.5.3
|
65 |
+
parso==0.8.3
|
66 |
+
pexpect==4.8.0
|
67 |
+
pickleshare==0.7.5
|
68 |
+
Pillow==9.4.0
|
69 |
+
pip==23.0.1
|
70 |
+
platformdirs==2.5.2
|
71 |
+
pooch==1.4.0
|
72 |
+
prompt-toolkit==3.0.36
|
73 |
+
protobuf
|
74 |
+
psutil==5.9.0
|
75 |
+
ptyprocess==0.7.0
|
76 |
+
pure-eval==0.2.2
|
77 |
+
pyarrow==11.0.0
|
78 |
+
pyasn1==0.4.8
|
79 |
+
pyasn1-modules==0.2.8
|
80 |
+
pycparser==2.21
|
81 |
+
pydeck==0.7.1
|
82 |
+
Pygments==2.11.2
|
83 |
+
PyJWT==2.4.0
|
84 |
+
Pympler==0.9
|
85 |
+
pyOpenSSL==23.0.0
|
86 |
+
pyrsistent==0.18.0
|
87 |
+
PySocks==1.7.1
|
88 |
+
python-dateutil==2.8.2
|
89 |
+
pytz==2022.7
|
90 |
+
pyzmq==23.2.0
|
91 |
+
requests==2.28.1
|
92 |
+
requests-oauthlib==1.3.0
|
93 |
+
rich==12.5.1
|
94 |
+
rsa==4.7.2
|
95 |
+
scipy==1.10.0
|
96 |
+
semver==2.13.0
|
97 |
+
setuptools==66.0.0
|
98 |
+
six==1.16.0
|
99 |
+
smmap==4.0.0
|
100 |
+
stack-data==0.2.0
|
101 |
+
streamlit==1.16.0
|
102 |
+
tensorboard==2.10.0
|
103 |
+
tensorboard-data-server==0.6.1
|
104 |
+
tensorboard-plugin-wit==1.7.0
|
105 |
+
tensorflow==2.10.0
|
106 |
+
tensorflow-estimator==2.10.0
|
107 |
+
termcolor==2.1.0
|
108 |
+
toml==0.10.2
|
109 |
+
toolz==0.12.0
|
110 |
+
tornado==6.2
|
111 |
+
traitlets==5.7.1
|
112 |
+
typing_extensions==4.5.0
|
113 |
+
tzlocal==2.1
|
114 |
+
urllib3==1.26.15
|
115 |
+
validators==0.18.2
|
116 |
+
wcwidth==0.2.5
|
117 |
+
Werkzeug==2.2.3
|
118 |
+
wheel==0.35.1
|
119 |
+
widgetsnbextension==4.0.5
|
120 |
+
wrapt==1.14.1
|
121 |
+
yarl==1.8.1
|
122 |
+
zipp==3.11.0
|