Kalbe-x-Bangkit
commited on
Commit
•
96c8bed
1
Parent(s):
33daad3
Open input_image again.
Browse files
app.py
CHANGED
@@ -467,11 +467,12 @@ if uploaded_file is not None:
|
|
467 |
image = cv2.imdecode(file_bytes, 1)
|
468 |
if st.button('Auto Detect'):
|
469 |
st.write("Processing...")
|
470 |
-
|
471 |
# input_image = enhancement_type
|
472 |
input_image = cv2.resize(enhanced_image, (W, H)) # Resize the enhanced image to the required input size
|
473 |
input_image = (input_image - 127.5) / 127.5 # Normalize to [-1, +1]
|
474 |
input_image = np.expand_dims(input_image, axis=0).astype(np.float32) # Expand dimensions and convert to float32
|
|
|
475 |
pred_bbox, pred_label, pred_label_confidence = predict(model_detection, input_image)
|
476 |
|
477 |
# Updated label mapping based on the dataset
|
|
|
467 |
image = cv2.imdecode(file_bytes, 1)
|
468 |
if st.button('Auto Detect'):
|
469 |
st.write("Processing...")
|
470 |
+
input_image = preprocess_image(image)
|
471 |
# input_image = enhancement_type
|
472 |
input_image = cv2.resize(enhanced_image, (W, H)) # Resize the enhanced image to the required input size
|
473 |
input_image = (input_image - 127.5) / 127.5 # Normalize to [-1, +1]
|
474 |
input_image = np.expand_dims(input_image, axis=0).astype(np.float32) # Expand dimensions and convert to float32
|
475 |
+
|
476 |
pred_bbox, pred_label, pred_label_confidence = predict(model_detection, input_image)
|
477 |
|
478 |
# Updated label mapping based on the dataset
|