File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 1- #!/usr/bin/env python3
1+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2+ # All rights reserved.
3+ #
4+ # This source code is licensed under the BSD-style license found in the
5+ # LICENSE file in the root directory of this source tree.
6+
27import os
38import subprocess
49
712import torch
813from PIL import Image
914
10- # Copyright (c) Meta Platforms, Inc. and affiliates.
11- # All rights reserved.
12- #
13- # This source code is licensed under the BSD-style license found in the
14- # LICENSE file in the root directory of this source tree.
15-
1615# Run this script to update the resources used in unit tests. The resources are all derived
1716# from source media already checked into the repo.
1817
@@ -24,8 +23,6 @@ def convert_image_to_tensor(image_path):
2423 base_filename = os .path .splitext (image_path )[0 ]
2524 pil_image = Image .open (image_path )
2625 img_tensor = torch .from_numpy (np .asarray (pil_image ))
27- print (img_tensor .shape )
28- print (img_tensor .dtype )
2926 # Save tensor to disk
3027 torch .save (img_tensor , base_filename + ".pt" , _use_new_zipfile_serialization = True )
3128 os .remove (image_path )
You can’t perform that action at this time.
0 commit comments