fix camera path bug

This commit is contained in:
xiaoke@ivgsz_171 2023-02-07 15:36:51 +08:00
parent 1c1cdca2a3
commit a308bfee18

View File

@ -230,7 +230,7 @@ class Base(BaseData):
self.reader = reader self.reader = reader
self.writer = writer self.writer = writer
if camera != 'none': if camera != 'none':
if not os.path.isabs(camera): if not os.path.exists(camera) and not os.path.isabs(camera):
camera = join(self.root, camera) camera = join(self.root, camera)
if os.path.exists(camera): if os.path.exists(camera):
cameras = read_cameras(camera) cameras = read_cameras(camera)
@ -464,7 +464,10 @@ class ImageFolder(Base):
data[key] = Undistort.points(data[key], K, dist) data[key] = Undistort.points(data[key], K, dist)
data[key+'_unproj'] = unproj(data[key], invK) data[key+'_unproj'] = unproj(data[key], invK)
for _key in [key, key+'_distort', key+'_unproj']: for _key in [key, key+'_distort', key+'_unproj']:
try:
self.cache_shape[_key] = np.zeros_like(data[_key]) self.cache_shape[_key] = np.zeros_like(data[_key])
except KeyError:
print(f"missed key: {_key}")
if self.loadmp: if self.loadmp:
data['annots'] = data['annots']['annots'] data['annots'] = data['annots']['annots']
# compose the data # compose the data