3v324v23 commited on
Commit
f740d4a
·
1 Parent(s): 6ee7888

latest.zip

Browse files
anydoor/run_inference_train_x.py CHANGED
@@ -256,7 +256,7 @@ if __name__ == '__main__':
256
  os.makedirs(save_dir)
257
 
258
  # Create list of cloth image names
259
- cloth_image_names = os.listdir(cloth_dir)[:5]
260
 
261
  # First loop for the top half
262
  for cloth_image_name in cloth_image_names:
@@ -288,13 +288,13 @@ if __name__ == '__main__':
288
 
289
 
290
  # Update the cloth directory and mask path for the bottom half processing
291
- cloth_dir = '/work/pink_girl/cloth/trou'
292
  fixed_ref_mask_path = os.path.join(image_parse_v3_dir, 'trou1.png')
293
- cloth_image_names = os.listdir(cloth_dir)[:5]
294
 
295
  # Second loop for the bottom half
296
  for cloth_image_name in cloth_image_names:
297
- cloth_image_path = os.path.join(cloth_dir, cloth_image_name)
298
  cloth_mask_path = os.path.join(cloth_mask_dir, cloth_image_name)
299
 
300
  cloth_image = cv2.imread(cloth_image_path)
@@ -304,7 +304,7 @@ if __name__ == '__main__':
304
  ref_image = cv2.imread(fixed_ref_image_path)
305
  ref_image = cv2.cvtColor(ref_image, cv2.COLOR_BGR2RGB)
306
  ref_mask = Image.open(fixed_ref_mask_path).convert('P')
307
- ref_mask = np.array(ref_mask) == 2
308
 
309
  gen_image = inference_single_image(cloth_image, cloth_mask, ref_image, ref_mask)
310
  gen_path = os.path.join(save_dir, 'gen_pant_' + cloth_image_name)
@@ -318,5 +318,5 @@ if __name__ == '__main__':
318
 
319
  # Replace the resizing and padding code for the bottom half
320
  bottom_image_path = os.path.join(save_dir, 'bottom_z_' + cloth_image_name)
321
- bottom_half_cropped = resize_and_crop(gen_image, 512, 600, False, True)
322
  cv2.imwrite(bottom_image_path, cv2.cvtColor(bottom_half_cropped, cv2.COLOR_RGB2BGR))
 
256
  os.makedirs(save_dir)
257
 
258
  # Create list of cloth image names
259
+ cloth_image_names = os.listdir(cloth_dir)[:40]
260
 
261
  # First loop for the top half
262
  for cloth_image_name in cloth_image_names:
 
288
 
289
 
290
  # Update the cloth directory and mask path for the bottom half processing
291
+ cloth_dir1 = '/work/pink_girl/cloth/trou'
292
  fixed_ref_mask_path = os.path.join(image_parse_v3_dir, 'trou1.png')
293
+ cloth_image_names = os.listdir(cloth_dir1)[:40]
294
 
295
  # Second loop for the bottom half
296
  for cloth_image_name in cloth_image_names:
297
+ cloth_image_path = os.path.join(cloth_dir1, cloth_image_name)
298
  cloth_mask_path = os.path.join(cloth_mask_dir, cloth_image_name)
299
 
300
  cloth_image = cv2.imread(cloth_image_path)
 
304
  ref_image = cv2.imread(fixed_ref_image_path)
305
  ref_image = cv2.cvtColor(ref_image, cv2.COLOR_BGR2RGB)
306
  ref_mask = Image.open(fixed_ref_mask_path).convert('P')
307
+ ref_mask = np.array(ref_mask) == 1
308
 
309
  gen_image = inference_single_image(cloth_image, cloth_mask, ref_image, ref_mask)
310
  gen_path = os.path.join(save_dir, 'gen_pant_' + cloth_image_name)
 
318
 
319
  # Replace the resizing and padding code for the bottom half
320
  bottom_image_path = os.path.join(save_dir, 'bottom_z_' + cloth_image_name)
321
+ bottom_half_cropped = resize_and_crop(gen_image, 512, 700, False, True)
322
  cv2.imwrite(bottom_image_path, cv2.cvtColor(bottom_half_cropped, cv2.COLOR_RGB2BGR))
adbase-step=48745.ckpt → latest.zip RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ed60705f20bdde1951e9dd280eacc1849a16bc5e6aff277aa52e5cc6f577c6a8
3
- size 16836620107
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2dff0561936fc60ed86ab1c4da9a2654a43e98228c15d84fe189d2bfd3952ce
3
+ size 109296642