Skip to content

Commit 8ef5ae7

Browse files
committed
NeRF replay parameter improvements for SDK 1.23.1
1 parent 61afff9 commit 8ef5ae7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

python/mapping/replay_to_nerf.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def transform_camera(c):
9595
}
9696
if 'depth_image_path' in c:
9797
converted['depth_file_path'] = "./images/" + c['depth_image_path'].split('/')[-1]
98-
98+
9999
by_camera[cam_id]['frames'].append(converted)
100100

101101
if len(by_camera) != 1:
@@ -282,7 +282,7 @@ def onMappingOutput(output):
282282
keyFrame = output.map.keyFrames.get(frameId)
283283

284284
cameraPose = keyFrame.frameSet.rgbFrame.cameraPose
285-
285+
286286
# Camera data
287287
frame = {
288288
"image_path": f"data/{name}/images/frame_{index:05}.png",
@@ -296,13 +296,13 @@ def onMappingOutput(output):
296296
oldImgName = f"{args.output}/tmp/frame_{frameId:05}.png"
297297
newImgName = f"{args.output}/images/frame_{index:05}.png"
298298
os.rename(oldImgName, newImgName)
299-
299+
300300
oldDepth = f"{args.output}/tmp/depth_{frameId:05}.png"
301301
newDepth = f"{args.output}/images/depth_{index:05}.png"
302302
if os.path.exists(oldDepth):
303303
os.rename(oldDepth, newDepth)
304304
frame['depth_image_path'] = f"data/{name}/images/depth_{index:05}.png"
305-
305+
306306
if (index + 3) % 7 == 0:
307307
validationFrames.append(frame)
308308
else:
@@ -369,7 +369,8 @@ def main():
369369
config = {
370370
"maxMapSize": 0,
371371
"useSlam": True,
372-
"rotateMapOnFirstNCandidates": 200,
372+
"rotateMapOnFirstNCandidates": 20,
373+
"rotateMapThresholdDegrees": 0.5,
373374
"keyframeDecisionDistanceThreshold": args.key_frame_distance,
374375
"icpVoxelSize": min(args.key_frame_distance, 0.1),
375376
"mapSavePath": f"{args.output}/points.sparse.csv"
@@ -386,7 +387,7 @@ def main():
386387
# remove these to further trade off speed for quality
387388
mid_q = {
388389
'maxKeypoints': 1000,
389-
'optimizerMaxIterations': 10
390+
'optimizerMaxIterations': 30
390391
}
391392
for k, v in mid_q.items(): config[k] = v
392393

0 commit comments

Comments
 (0)