@@ -96,7 +96,9 @@ def readColmapCameras(cam_extrinsics, cam_intrinsics, images_folder):
96
96
97
97
image_path = os .path .join (images_folder , os .path .basename (extr .name ))
98
98
image_name = os .path .basename (image_path ).split ("." )[0 ]
99
- image = Image .open (image_path )
99
+ image_fs = Image .open (image_path )
100
+ image = image_fs .copy ()
101
+ image_fs .close ()
100
102
101
103
cam_info = CameraInfo (uid = uid , R = R , T = T , FovY = FovY , FovX = FovX , image = image ,
102
104
image_path = image_path , image_name = image_name , width = width , height = height )
@@ -199,6 +201,9 @@ def readCamerasFromTransforms(path, transformsfile, white_background, extension=
199
201
200
202
image_path = os .path .join (path , cam_name )
201
203
image_name = Path (cam_name ).stem
204
+ image_fs = Image .open (image_path )
205
+ image = image_fs .copy ()
206
+ image_fs .close ()
202
207
image = Image .open (image_path )
203
208
204
209
im_data = np .array (image .convert ("RGBA" ))
@@ -257,4 +262,4 @@ def readNerfSyntheticInfo(path, white_background, eval, extension=".png"):
257
262
sceneLoadTypeCallbacks = {
258
263
"Colmap" : readColmapSceneInfo ,
259
264
"Blender" : readNerfSyntheticInfo
260
- }
265
+ }
0 commit comments