File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -41,18 +41,18 @@ def smoke_test_torchvision() -> None:
41
41
print ('Is torchvision useable?' , all (x is not None for x in [torch .ops .image .decode_png , torch .ops .torchvision .roi_align ]))
42
42
43
43
def smoke_test_torchvision_read_decode () -> None :
44
- from torchvision .io import decode_image , read_file
45
- img_jpg = read_file (str (pathlib .Path (__file__ ).parent / 'assets' / 'rgb_pytorch.jpg' ))
46
- img_jpg_nv = decode_image ( img_jpg )
47
- img_png = read_file (str (pathlib .Path (__file__ ).parent / 'assets' / 'rgb_pytorch.png' ))
48
- img_png_nv = decode_image ( img_png )
44
+ from torchvision .io import read_image
45
+ img_jpg = read_image (str (pathlib .Path (__file__ ).parent / 'assets' / 'rgb_pytorch.jpg' ))
46
+ assert img_jpg . ndim == 3 and img_jpg . numel () > 100
47
+ img_png = read_image (str (pathlib .Path (__file__ ).parent / 'assets' / 'rgb_pytorch.png' ))
48
+ assert img_png . ndim == 3 and img_png . numel () > 100
49
49
50
50
def smoke_test_torchvision_resnet50_classify () -> None :
51
51
from torchvision .io import read_image
52
52
from torchvision .models import resnet50 , ResNet50_Weights
53
53
54
54
img = read_image (str (pathlib .Path (__file__ ).parent / 'assets' / 'dog2.jpg' ))
55
- assert img . ndim == 3 and img . numel () > 100
55
+
56
56
# Step 1: Initialize model with the best available weights
57
57
weights = ResNet50_Weights .DEFAULT
58
58
model = resnet50 (weights = weights )
You can’t perform that action at this time.
0 commit comments