Kalbe-x-Bangkit commited on
Commit
1fe7054
1 Parent(s): bd4caee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -52,14 +52,14 @@ def load_model_detection():
52
  )
53
  return model
54
 
55
- def preprocess_image(image):
56
- """ Preprocess the image to the required size and normalization. """
57
- W = 320
58
- H = 320
59
- image = cv2.resize(image, (W, H))
60
- image = (image - 127.5) / 127.5 # Normalize to [-1, +1]
61
- image = np.expand_dims(image, axis=0).astype(np.float32)
62
- return image
63
 
64
 
65
 
@@ -469,7 +469,7 @@ if uploaded_file is not None:
469
  image = cv2.imdecode(file_bytes, 1)
470
  if st.button('Auto Detect'):
471
  st.write("Processing...")
472
- input_image = preprocess_image(image)
473
  # input_image = enhancement_type
474
  # input_image = cv2.resize(enhanced_image, (W, H)) # Resize the enhanced image to the required input size
475
  # input_image = (input_image - 127.5) / 127.5 # Normalize to [-1, +1]
 
52
  )
53
  return model
54
 
55
+ # def preprocess_image(image):
56
+ # """ Preprocess the image to the required size and normalization. """
57
+ # W = 320
58
+ # H = 320
59
+ # image = cv2.resize(image, (W, H))
60
+ # image = (image - 127.5) / 127.5 # Normalize to [-1, +1]
61
+ # image = np.expand_dims(image, axis=0).astype(np.float32)
62
+ # return image
63
 
64
 
65
 
 
469
  image = cv2.imdecode(file_bytes, 1)
470
  if st.button('Auto Detect'):
471
  st.write("Processing...")
472
+ input_image = image
473
  # input_image = enhancement_type
474
  # input_image = cv2.resize(enhanced_image, (W, H)) # Resize the enhanced image to the required input size
475
  # input_image = (input_image - 127.5) / 127.5 # Normalize to [-1, +1]