Spaces:
Runtime error
Runtime error
commit
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ model_V1 = 'indian_efficientnet_b0.pt'
|
|
19 |
@st.cache()
|
20 |
def model_prediction(model_path, img_file, rescale,selected_location):
|
21 |
input_img, device = load_prepare_img(img_file)
|
22 |
-
if(selected_location=='
|
23 |
model = getmodel_outside_india(model_path)
|
24 |
prediction = make_pred_outside_india(input_img, model, device, selected_location)
|
25 |
elif(selected_location=='India'):
|
@@ -46,7 +46,7 @@ def main():
|
|
46 |
with col1:
|
47 |
# image uploading button
|
48 |
uploaded_file = st.file_uploader("Choose a file")
|
49 |
-
selected_location = st.selectbox('Select loaction',('India', '
|
50 |
if uploaded_file is not None:
|
51 |
display_img = uploaded_file.read()
|
52 |
uploaded_img = Image.open(uploaded_file)
|
@@ -74,7 +74,7 @@ def main():
|
|
74 |
if selected_location == 'India':
|
75 |
pred_model = model_V1
|
76 |
pred_rescale = True
|
77 |
-
if selected_location == '
|
78 |
pred_model = model_V2
|
79 |
pred_rescale =True
|
80 |
|
|
|
19 |
@st.cache()
|
20 |
def model_prediction(model_path, img_file, rescale,selected_location):
|
21 |
input_img, device = load_prepare_img(img_file)
|
22 |
+
if(selected_location=='Outside India'):
|
23 |
model = getmodel_outside_india(model_path)
|
24 |
prediction = make_pred_outside_india(input_img, model, device, selected_location)
|
25 |
elif(selected_location=='India'):
|
|
|
46 |
with col1:
|
47 |
# image uploading button
|
48 |
uploaded_file = st.file_uploader("Choose a file")
|
49 |
+
selected_location = st.selectbox('Select loaction',('India', 'Outside India'), index=1)
|
50 |
if uploaded_file is not None:
|
51 |
display_img = uploaded_file.read()
|
52 |
uploaded_img = Image.open(uploaded_file)
|
|
|
74 |
if selected_location == 'India':
|
75 |
pred_model = model_V1
|
76 |
pred_rescale = True
|
77 |
+
if selected_location == 'Outside India':
|
78 |
pred_model = model_V2
|
79 |
pred_rescale =True
|
80 |
|