Skip to content

Commit d1e51b3

Browse files
committed
Merge branch 'main' of github.com:pytorch/torchcodec into aeaenjfjanef
2 parents 560b376 + 37e361a commit d1e51b3

File tree

8 files changed

+19
-32
lines changed

8 files changed

+19
-32
lines changed

.github/workflows/build_ffmpeg.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
with:
3636
job-name: Build
3737
upload-artifact: ffmpeg-lgpl-linux_x86_64-${{ matrix.ffmpeg-version }}
38-
repository: pytorch/torchcodec
38+
repository: meta-pytorch/torchcodec
3939
script: |
4040
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
4141
export FFMPEG_ROOT="${PWD}/ffmpeg"
@@ -57,7 +57,7 @@ jobs:
5757
with:
5858
job-name: Build
5959
upload-artifact: ffmpeg-lgpl-macos-${{ matrix.ffmpeg-version }}
60-
repository: pytorch/torchcodec
60+
repository: meta-pytorch/torchcodec
6161
runner: macos-14-xlarge
6262
script: |
6363
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
@@ -80,7 +80,7 @@ jobs:
8080
with:
8181
job-name: Build
8282
upload-artifact: ffmpeg-lgpl-windows_x86_64-${{ matrix.ffmpeg-version }}
83-
repository: pytorch/torchcodec
83+
repository: meta-pytorch/torchcodec
8484
script: |
8585
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
8686
export FFMPEG_ROOT="${PWD}/ffmpeg"

.github/workflows/docs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
name: Build and Upload wheel
3434
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
3535
with:
36-
repository: pytorch/torchcodec
36+
repository: meta-pytorch/torchcodec
3737
ref: ""
3838
test-infra-repository: pytorch/test-infra
3939
test-infra-ref: main
@@ -70,7 +70,7 @@ jobs:
7070
echo python_version_without_periods=${python_version_without_periods} >> $GITHUB_ENV
7171
- uses: actions/download-artifact@v4
7272
with:
73-
name: pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64
73+
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64
7474
path: pytorch/torchcodec/dist/
7575
- name: Setup miniconda using test-infra
7676
uses: pytorch/test-infra/.github/actions/setup-miniconda@main

.github/workflows/linux_cuda_wheel.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
name: Build and Upload wheel
4444
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
4545
with:
46-
repository: pytorch/torchcodec
46+
repository: meta-pytorch/torchcodec
4747
ref: ""
4848
test-infra-repository: pytorch/test-infra
4949
test-infra-ref: main
@@ -86,7 +86,7 @@ jobs:
8686
echo python_version_without_periods=${python_version_without_periods} >> $GITHUB_ENV
8787
- uses: actions/download-artifact@v4
8888
with:
89-
name: pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64
89+
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64
9090
path: pytorch/torchcodec/dist/
9191
- name: Setup miniconda using test-infra
9292
uses: pytorch/test-infra/.github/actions/setup-miniconda@main

.github/workflows/linux_wheel.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
name: Build and Upload Linux wheel
4545
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
4646
with:
47-
repository: pytorch/torchcodec
47+
repository: meta-pytorch/torchcodec
4848
ref: ""
4949
test-infra-repository: pytorch/test-infra
5050
test-infra-ref: main
@@ -68,7 +68,7 @@ jobs:
6868
steps:
6969
- uses: actions/download-artifact@v4
7070
with:
71-
name: pytorch_torchcodec__${{ matrix.python-version }}_cpu_x86_64
71+
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cpu_x86_64
7272
path: pytorch/torchcodec/dist/
7373
- name: Setup conda env
7474
uses: conda-incubator/setup-miniconda@v2

.github/workflows/macos_wheel.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
name: Build and Upload Mac wheel
4545
uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@main
4646
with:
47-
repository: pytorch/torchcodec
47+
repository: meta-pytorch/torchcodec
4848
ref: ""
4949
test-infra-repository: pytorch/test-infra
5050
test-infra-ref: main
@@ -71,7 +71,7 @@ jobs:
7171
- name: Download wheel
7272
uses: actions/download-artifact@v4
7373
with:
74-
name: pytorch_torchcodec__${{ matrix.python-version }}_cpu_
74+
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cpu_
7575
path: pytorch/torchcodec/dist/
7676

7777
- name: Setup conda env

.github/workflows/windows_wheel.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
name: Build and Upload Windows wheel
4747
uses: pytorch/test-infra/.github/workflows/build_wheels_windows.yml@main
4848
with:
49-
repository: pytorch/torchcodec
49+
repository: meta-pytorch/torchcodec
5050
ref: ""
5151
test-infra-repository: pytorch/test-infra
5252
test-infra-ref: main
@@ -76,7 +76,7 @@ jobs:
7676
steps:
7777
- uses: actions/download-artifact@v4
7878
with:
79-
name: pytorch_torchcodec__${{ matrix.python-version }}_cpu_x64
79+
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cpu_x64
8080
path: pytorch/torchcodec/dist/
8181
- name: Setup conda env
8282
uses: conda-incubator/setup-miniconda@v2

src/torchcodec/_samplers/video_clip_sampler.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,12 @@ class IndexBasedSamplerArgs(SamplerArgs):
105105
sample_step: int = 1
106106

107107

108-
class VideoClipSampler(nn.Module):
108+
class DEPRECATED_VideoClipSampler(nn.Module):
109109
"""
110-
VideoClipSampler will do video clip sampling with given video args and sampler args.
111-
The video args contains video related information, frames_per_clip, dimensions etc.
112-
The sampler args can be either time-based or index-based, it will be used to decide clip start time pts or index.
113-
ClipSampling support, random, uniform, periodic, target, keyframe sampling etc.
110+
DEPRECATED: Do not use. The supported samplers are in `torchcodec.samplers`. See:
114111
115-
Args:
116-
video_args (`VideoArgs`): The video args
117-
sampler_args (`SamplerArgs`): The sampler args. Can be TimeBasedSamplerArgs or IndexBasedSamplerArgs
118-
decoder_args (`DecoderArgs`): Decoder args contain value needs for decoder, for example, thread count
119-
120-
Example:
121-
>>> video_args = VideoArgs(desired_width=224, desired_height=224)
122-
>>> time_based_sampler_args = TimeBasedSamplerArgs(sampler_type="random", clips_per_video=1, frames_per_clip=4)
123-
>>> video_decoder_args = DecoderArgs(num_threads=1)
124-
>>> video_clip_sampler = VideoClipSampler(video_args, time_based_sampler_args, decoder_args)
125-
>>> clips = video_clip_sampler(video_data)
126-
clips now contains a list of clip, where clip is a list of frame tensors, each tensor represents a frame image.
112+
* https://docs.pytorch.org/torchcodec/stable/api_ref_torchcodec.html
113+
* https://docs.pytorch.org/torchcodec/stable/generated_examples/decoding/sampling.html
127114
"""
128115

129116
def __init__(

test/test_video_clip_sampler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import pytest
55
import torch
66
from torchcodec._samplers import (
7+
DEPRECATED_VideoClipSampler,
78
IndexBasedSamplerArgs,
89
TimeBasedSamplerArgs,
910
VideoArgs,
10-
VideoClipSampler,
1111
)
1212

1313
from .utils import NASA_VIDEO
@@ -34,7 +34,7 @@ def test_sampler(sampler_args):
3434
torch.manual_seed(0)
3535
desired_width, desired_height = 320, 240
3636
video_args = VideoArgs(desired_width=desired_width, desired_height=desired_height)
37-
sampler = VideoClipSampler(video_args, sampler_args)
37+
sampler = DEPRECATED_VideoClipSampler(video_args, sampler_args)
3838
clips = sampler(NASA_VIDEO.to_tensor())
3939
assert len(clips) == sampler_args.clips_per_video
4040
clip = clips[0]

0 commit comments

Comments
 (0)