dfdfd
Browse files
app.py
CHANGED
|
@@ -52,10 +52,10 @@ def predict_image(name_image):
|
|
| 52 |
import requests
|
| 53 |
|
| 54 |
url = "https://huggingface.co/valencar/modelo_raios_x/blob/main/dados_teste/CHNCXR_0001_0.png"
|
| 55 |
-
|
| 56 |
-
req = requests.get(url, stream=True).raw
|
| 57 |
-
image_hf = Image.open(req)
|
| 58 |
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
img = img_orig = image.load_img(image_hf, target_size = (IMAGE_HEIGHT, IMAGE_WIDTH))
|
| 61 |
img = image.img_to_array(img)
|
|
@@ -103,9 +103,9 @@ def inicializa_modelo():
|
|
| 103 |
return model
|
| 104 |
|
| 105 |
|
| 106 |
-
if 'model' not in st.session_state:
|
| 107 |
-
|
| 108 |
-
|
| 109 |
|
| 110 |
with st.container():
|
| 111 |
col1 = st.container()
|
|
|
|
| 52 |
import requests
|
| 53 |
|
| 54 |
url = "https://huggingface.co/valencar/modelo_raios_x/blob/main/dados_teste/CHNCXR_0001_0.png"
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
+
req = requests.get(url, stream=True).raw
|
| 57 |
+
#image_hf = Image.open(req)
|
| 58 |
+
image_hf = req
|
| 59 |
|
| 60 |
img = img_orig = image.load_img(image_hf, target_size = (IMAGE_HEIGHT, IMAGE_WIDTH))
|
| 61 |
img = image.img_to_array(img)
|
|
|
|
| 103 |
return model
|
| 104 |
|
| 105 |
|
| 106 |
+
# if 'model' not in st.session_state:
|
| 107 |
+
# with st.spinner('carregando o modelo...'):
|
| 108 |
+
# st.session_state.model = inicializa_modelo()
|
| 109 |
|
| 110 |
with st.container():
|
| 111 |
col1 = st.container()
|