IkerJau commited on
Commit
fd3ec83
·
1 Parent(s): c32bc0f

RGB to BGR

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -10,7 +10,9 @@ API_URL = "https://mlops-lab3-jauregui-latest.onrender.com"
10
  # Function to execute when clicking the "Predict button"
11
  def predict(image):
12
  try:
13
- _, img_encoded = cv2.imencode(".jpg", image)
 
 
14
  files = {"file": ("image.jpg", img_encoded.tobytes(), "image/jpeg")}
15
 
16
  response = requests.post(f"{API_URL}/predict", files=files, timeout=120)
 
10
  # Function to execute when clicking the "Predict button"
11
  def predict(image):
12
  try:
13
+ image_bgr = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
14
+
15
+ _, img_encoded = cv2.imencode(".jpg", image_bgr)
16
  files = {"file": ("image.jpg", img_encoded.tobytes(), "image/jpeg")}
17
 
18
  response = requests.post(f"{API_URL}/predict", files=files, timeout=120)