syedfaisalabrar commited on
Commit
d79e816
·
verified ·
1 Parent(s): fd03738

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -20,12 +20,12 @@ def preprocessing(image):
20
  """Apply three enhancement filters, including brightness reduction, and resize."""
21
  image = Image.fromarray(np.array(image))
22
 
23
- # Apply enhancements
24
  image = ImageEnhance.Sharpness(image).enhance(2.0) # Increase sharpness
25
  image = ImageEnhance.Contrast(image).enhance(1.5) # Increase contrast
26
  image = ImageEnhance.Brightness(image).enhance(0.8) # Reduce brightness
27
 
28
- # Resize image to 800px width while maintaining aspect ratio
29
  width = 800
30
  aspect_ratio = image.height / image.width
31
  height = int(width * aspect_ratio)
@@ -108,7 +108,7 @@ def predict(image):
108
  if "back" in cropped_images:
109
  back_result = vision_ai_api(cropped_images["back"], "back")
110
 
111
- # Combine API results into a single response
112
  api_results = {
113
  "front": front_result,
114
  "back": back_result
 
20
  """Apply three enhancement filters, including brightness reduction, and resize."""
21
  image = Image.fromarray(np.array(image))
22
 
23
+
24
  image = ImageEnhance.Sharpness(image).enhance(2.0) # Increase sharpness
25
  image = ImageEnhance.Contrast(image).enhance(1.5) # Increase contrast
26
  image = ImageEnhance.Brightness(image).enhance(0.8) # Reduce brightness
27
 
28
+
29
  width = 800
30
  aspect_ratio = image.height / image.width
31
  height = int(width * aspect_ratio)
 
108
  if "back" in cropped_images:
109
  back_result = vision_ai_api(cropped_images["back"], "back")
110
 
111
+
112
  api_results = {
113
  "front": front_result,
114
  "back": back_result