Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
# from streamlit_webrtc import webrtc_streamer, VideoTransformerBase, RTCConfiguration, VideoProcessorBase, WebRtcMode
|
8 |
import numpy as np
|
9 |
import tensorflow
|
|
|
10 |
import cv2
|
11 |
import streamlit as st
|
12 |
from tensorflow import keras
|
@@ -117,10 +118,8 @@ def main():
|
|
117 |
st.header("Image Prediction App")
|
118 |
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
|
119 |
if uploaded_file is not None:
|
120 |
-
|
121 |
-
|
122 |
-
temp.seek(0)
|
123 |
-
image = cv2.imread(temp.name)
|
124 |
prediction = generate_prediction(image)
|
125 |
st.image(prediction, use_column_width=True)
|
126 |
# elif choice == "By Images":
|
|
|
7 |
# from streamlit_webrtc import webrtc_streamer, VideoTransformerBase, RTCConfiguration, VideoProcessorBase, WebRtcMode
|
8 |
import numpy as np
|
9 |
import tensorflow
|
10 |
+
from PIL import Image
|
11 |
import cv2
|
12 |
import streamlit as st
|
13 |
from tensorflow import keras
|
|
|
118 |
st.header("Image Prediction App")
|
119 |
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
|
120 |
if uploaded_file is not None:
|
121 |
+
image = np.array(Image.open(uploaded_file))
|
122 |
+
|
|
|
|
|
123 |
prediction = generate_prediction(image)
|
124 |
st.image(prediction, use_column_width=True)
|
125 |
# elif choice == "By Images":
|