Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video datasets: Pregenerated, and Vimeo90K #272

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

YodaEmbedding
Copy link
Contributor

@YodaEmbedding YodaEmbedding commented Feb 26, 2024

Added mode="video" parameter to PreGeneratedMemmapDataset and Vimeo90kDataset.

To generate the pregenerated numpy datasets:

cd /data/datasets

mkdir -p vimeo90k
cd vimeo90k
wget http://data.csail.mit.edu/tofu/dataset/vimeo_triplet.zip
unzip vimeo_triplet.zip
wget http://data.csail.mit.edu/tofu/dataset/vimeo_septuplet.zip
unzip vimeo_septuplet.zip
cd ..

wget https://gist.githubusercontent.com/YodaEmbedding/8803d95de072f12b4ff14ffd2b5bd7e5/raw/9db2d7664984cc29b790f6b5268b971ec004c50c/generate_vimeo90k_npy_dataset.py

# NOTE: Ignore the first one if it already exists:
python generate_vimeo90k_npy_dataset.py --tuplet=3 --mode=image --indir="vimeo90k/vimeo_triplet" --outdir="vimeo90k/vimeo_triplet_npy"
python generate_vimeo90k_npy_dataset.py --tuplet=3 --mode=video --indir="vimeo90k/vimeo_triplet" --outdir="vimeo90k/vimeo_triplet_npy_video"
python generate_vimeo90k_npy_dataset.py --tuplet=7 --mode=image --indir="vimeo90k/vimeo_septuplet" --outdir="vimeo90k/vimeo_septuplet_npy"
python generate_vimeo90k_npy_dataset.py --tuplet=7 --mode=video --indir="vimeo90k/vimeo_septuplet" --outdir="vimeo90k/vimeo_septuplet_npy_video"

Example config (works only on latest CompressAI Trainer dev branch):

type: "PreGeneratedMemmapDataset"
config:
  root: "${paths.datasets}/vimeo90k/vimeo_septuplet_npy_video"
  split: "train"
  image_size: [ 256, 256, ]
  mode: "video"
  frames_per_sample: 7
loader:
  shuffle: True
  batch_size: 16
  num_workers: 2
settings:
  patch_size: [ 256, 256, ]
transforms:
  transform_frame:
    - "ToTensor": {}
  transform:
    - "RandomCrop": {size: "${.....settings.patch_size}"}
meta:
  name: "Vimeo-90K"
  identifier:
  num_samples: 64612
  steps_per_epoch:

@fracape
Copy link
Collaborator

fracape commented Apr 2, 2024

Hi @YodaEmbedding, this has been marked as WIP for a while. Is it ready for merge?

@YodaEmbedding
Copy link
Contributor Author

From my limited testing, it's probably good.

However, I did want to test it more thoroughly when working on Ujwal's project to confirm.

@fracape
Copy link
Collaborator

fracape commented Apr 2, 2024

SG, let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants