Skip to content

Commit 3f7692b

Browse files
authored
Fix thumbnails and resize image for image encoding / decoding examples (#1591)
1 parent a78ad84 commit 3f7692b

7 files changed

Lines changed: 4 additions & 6 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ docs/source/models/generated/
2222
docs/source/sg_execution_times.rst
2323
# pytorch-sphinx-theme gets installed here
2424
docs/src
25+
# generated by image encoding example
26+
examples/encoding/image.jpg
2527

2628
.coverage
2729
htmlcov
-156 KB
Binary file not shown.
-61.3 KB
Binary file not shown.
21.6 KB
Loading
20.5 KB
Loading

examples/decoding/image_decoding.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import requests
3333

3434

35-
url = "https://raw.githubusercontent.com/meta-pytorch/torchcodec/refs/heads/main/docs/source/_static/thumbnails/cat_decoding.jpeg"
35+
url = "https://raw.githubusercontent.com/meta-pytorch/torchcodec/refs/heads/main/docs/source/_static/thumbnails/pigeon_decoding.jpeg"
3636
response = requests.get(url, headers={"User-Agent": ""})
3737
if response.status_code != 200:
3838
raise RuntimeError(f"Failed to download image. {response.status_code = }.")
@@ -139,5 +139,3 @@ def plot(image: torch.Tensor):
139139
#
140140
# # A whole batch in one call (much faster than one-by-one):
141141
# images = decode_jpeg([img_0, img_1, img_2], device="cuda")
142-
143-
# sphinx_gallery_thumbnail_path = '_static/thumbnails/cat_decoding.jpeg'

examples/encoding/image_encoding.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from torchcodec.decoders import decode_image
2626

27-
url = "https://raw.githubusercontent.com/meta-pytorch/torchcodec/refs/heads/main/docs/source/_static/thumbnails/cat_encoding.jpeg"
27+
url = "https://raw.githubusercontent.com/meta-pytorch/torchcodec/refs/heads/main/docs/source/_static/thumbnails/pigeon_encoding.jpeg"
2828
response = requests.get(url, headers={"User-Agent": ""})
2929
if response.status_code != 200:
3030
raise RuntimeError(f"Failed to download image. {response.status_code = }.")
@@ -125,5 +125,3 @@ def plot(image: torch.Tensor):
125125
# %%
126126
# Check the docstrings of the encoding methods to learn about the different
127127
# encoding options.
128-
129-
# sphinx_gallery_thumbnail_path = '_static/thumbnails/cat_encoding.jpeg'

0 commit comments

Comments
 (0)