Skip to content

Commit

Permalink
Remove prints.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebezzam committed May 2, 2024
1 parent 9164e95 commit 6632695
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions scripts/data/upload_dataset_huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,13 @@ def upload_dataset(config):
def downsample(f, output_dir):
img = cv2.imread(f, cv2.IMREAD_UNCHANGED)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
print("Original shape:", img.shape)
img = cv2.resize(
img,
(0, 0),
fx=1 / config.lensless.downsample,
fy=1 / config.lensless.downsample,
interpolation=cv2.INTER_LINEAR,
)
print("Downsampled shape:", img.shape)
new_fp = os.path.join(output_dir, os.path.basename(f))
new_fp = new_fp.split(".")[0] + config.lensless.ext
save_image(img, new_fp, normalize=False)
Expand Down Expand Up @@ -273,7 +271,7 @@ def create_dataset(lensless_files, lensed_files, df_attr=None):
print(f"Total time: {(time.time() - start_time) / 60} minutes")

# delete PNG files
if config.lensless.eight_norm:
if config.lensless.eight_norm or config.lensless.downsample:
os.system(f"rm -rf {tmp_dir}")


Expand Down

0 comments on commit 6632695

Please sign in to comment.