aladhefafalquran commited on
Commit
0d3fffb
·
1 Parent(s): 24169f7

Increase AI context padding

Browse files
Files changed (1) hide show
  1. simple_lama.py +3 -1
simple_lama.py CHANGED
@@ -44,7 +44,9 @@ class SimpleLama:
44
  x1, x2 = np.min(cols), np.max(cols)
45
 
46
  # 2. Add padding to context
47
- pad = 50
 
 
48
  y1 = max(0, y1 - pad)
49
  y2 = min(image.shape[0], y2 + pad)
50
  x1 = max(0, x1 - pad)
 
44
  x1, x2 = np.min(cols), np.max(cols)
45
 
46
  # 2. Add padding to context
47
+ # Increased padding from 50 to 200 to give the AI more context of the background
48
+ # This helps preventing "flat color" patches on gradients or textured backgrounds.
49
+ pad = 200
50
  y1 = max(0, y1 - pad)
51
  y2 = min(image.shape[0], y2 + pad)
52
  x1 = max(0, x1 - pad)