shubham680 commited on
Commit
d2129ef
·
verified ·
1 Parent(s): ee83694

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -207,8 +207,14 @@ if uploaded_file is not None:
207
 
208
  if transformation:
209
  clear_folder()
210
- per_trans = max(1,(image_count // len(transformation)))
211
- trans_count=[per_trans+1 if (per_trans * len(transformation))!= image_count else per_trans][0]
 
 
 
 
 
 
212
 
213
  if "Translation" in transformation:
214
  translation(img,trans_count)
 
207
 
208
  if transformation:
209
  clear_folder()
210
+ # per_trans = max(1,(image_count // len(transformation)))
211
+ # trans_count=[per_trans+1 if (per_trans * len(transformation))!= image_count else per_trans][0]
212
+ num_trans = len(transformation)
213
+ base = image_count // num_trans
214
+ remainder = image_count % num_trans
215
+
216
+ # Create a list like [base+1, base, base, ...] to ensure sum == image_count
217
+ counts = [base + 1 if i < remainder else base for i in range(num_trans)]
218
 
219
  if "Translation" in transformation:
220
  translation(img,trans_count)