Skip to content

Commit eeb972f

Browse files
committed
Adjust frame index in bboxes.json file
1 parent 5a1ee74 commit eeb972f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

meshroom/imageSegmentation/VideoSegmentationSam3Text.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def processChunk(self, chunk):
351351
crypto_id_fwd = np.zeros((img.shape[0], img.shape[1]), dtype=np.float32)
352352
crypto_cov_fwd = np.zeros((img.shape[0], img.shape[1]), dtype=np.float32)
353353
manifest_fwd = {}
354-
boxes[textPrompt]["forward"][frameId] = {}
354+
boxes[textPrompt]["forward"][firstFrameId + frameId] = {}
355355
for key, maskBoxProb in outputs_per_frame_visu[frameId].items():
356356
mask = maskBoxProb["mask"]
357357
mask_images[frameId][mask] = [255, 255, 255]
@@ -366,7 +366,7 @@ def processChunk(self, chunk):
366366
crypto_cov_fwd[mask] = 1.0
367367

368368
bbox = sam3Utils.xywhNorm2xyxy(maskBoxProb["box_xywh"], sourceInfo["w_ori"], sourceInfo["h_ori"]) # (x, y, x+w, y+h)
369-
boxes[textPrompt]["forward"][frameId][key] = bbox
369+
boxes[textPrompt]["forward"][firstFrameId + frameId][key] = bbox
370370

371371
if chunk.node.outputColorMasks.value:
372372
if chunk.node.keepFilename.value:
@@ -398,7 +398,7 @@ def processChunk(self, chunk):
398398
crypto_id_bwd = np.zeros((img.shape[0], img.shape[1]), dtype=np.float32)
399399
crypto_cov_bwd = np.zeros((img.shape[0], img.shape[1]), dtype=np.float32)
400400
manifest_bwd = {}
401-
boxes[textPrompt]["backward"][frameId] = {}
401+
boxes[textPrompt]["backward"][firstFrameId + frameId] = {}
402402
for key, maskBoxProb in outputs_per_frame_visu[frameId].items():
403403
mask = maskBoxProb["mask"]
404404
mask_images[frameId][mask] = [255, 255, 255]
@@ -411,7 +411,7 @@ def processChunk(self, chunk):
411411
crypto_id_bwd[mask] = f32_hash
412412
crypto_cov_bwd[mask] = 1.0
413413
bbox = sam3Utils.xywhNorm2xyxy(maskBoxProb["box_xywh"], sourceInfo["w_ori"], sourceInfo["h_ori"]) # (x, y, x+w, y+h)
414-
boxes[textPrompt]["backward"][frameId][key] = bbox
414+
boxes[textPrompt]["backward"][firstFrameId + frameId][key] = bbox
415415

416416
if chunk.node.outputColorMasks.value:
417417
if chunk.node.keepFilename.value:

0 commit comments

Comments
 (0)