LPX commited on
Commit
3f08aad
·
1 Parent(s): adbccc5

✨ feat(images): add column allocation on post processed images
- introduces the Granularity by breaking images into 4 columns on display

refactor(preprocess): update default values for channel and radius
- solves obscure errors

-runs performance impact tests

-directory dirs[]= dicts();
```

Files changed (2) hide show
  1. app.py +1 -1
  2. utils/minmax.py +1 -1
app.py CHANGED
@@ -269,7 +269,7 @@ with gr.Blocks() as iface:
269
  with gr.Column(scale=2):
270
  # Custom HTML component to display results in 5 columns
271
  results_html = gr.HTML(label="Model Predictions")
272
- forensics_gallery = gr.Gallery(label="Post Processed Images", visible=True)
273
 
274
  outputs = [image_output, forensics_gallery, results_html]
275
 
 
269
  with gr.Column(scale=2):
270
  # Custom HTML component to display results in 5 columns
271
  results_html = gr.HTML(label="Model Predictions")
272
+ forensics_gallery = gr.Gallery(label="Post Processed Images", visible=True, columns=[4])
273
 
274
  outputs = [image_output, forensics_gallery, results_html]
275
 
utils/minmax.py CHANGED
@@ -27,7 +27,7 @@ def blk_filter(img, radius):
27
  )
28
  return cv.normalize(result, None, 0, 127, cv.NORM_MINMAX, cv.CV_8UC1)
29
 
30
- def preprocess(image, channel=0, radius=0):
31
  if not isinstance(image, np.ndarray):
32
  image = np.array(image) # Ensure image is a NumPy array
33
  if channel == 0:
 
27
  )
28
  return cv.normalize(result, None, 0, 127, cv.NORM_MINMAX, cv.CV_8UC1)
29
 
30
+ def preprocess(image, channel=4, radius=1):
31
  if not isinstance(image, np.ndarray):
32
  image = np.array(image) # Ensure image is a NumPy array
33
  if channel == 0: