Skip to content

Commit

Permalink
Upload viewable version of 16 bits files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebezzam committed Jun 9, 2024
1 parent 515f62f commit 3193b60
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/data/upload_dataset_huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,20 @@ def create_dataset(lensless_files, lensed_files, df_attr=None):
repo_type="dataset",
token=hf_token,
)

# viewable version of file
img = cv2.imread(fp, cv2.IMREAD_UNCHANGED)
local_fp = f"{f}_viewable8bit.png"
remote_fn = f"{f}_viewable8bit.png"
save_image(img, local_fp, normalize=True)
upload_file(
path_or_fileobj=local_fp,
path_in_repo=remote_fn,
repo_id=repo_id,
repo_type="dataset",
token=hf_token,
)

dataset_dict.push_to_hub(repo_id, token=hf_token)

upload_file(
Expand Down

0 comments on commit 3193b60

Please sign in to comment.