Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions client/dive-common/singleCamera/association.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,20 @@ connect from clock.timestamp
process pairing
:: compute_measurements
:matching_methods input_pairs_only
:detection_pairing_method calibration
:detection_pairing_threshold 10
:calibration_file calibration.json
:min_track_states 0
# Same pairing as VIAME's stereo track-and-measure pipelines: head/tail
# keypoints where both cameras have them, box geometry (epipolar) otherwise.
:detection_pairing_method keypoint_projection,calibration
:detection_pairing_threshold 50.0
:detection_pairing_require_class_match false
:max_stereo_rms 20.0
:max_bbox_area_ratio 3.0
:accumulate_track_pairings true
:pairing_resolution_method most_likely
:detection_split_threshold 1
:output_unmatched true
# Each camera keeps the classes its own pipeline produced.
:average_stereo_classes false

connect from timestamps.timestamp
Expand Down
2 changes: 1 addition & 1 deletion docs/Multicamera-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Single camera pipelines can be used by selecting the camera and then running the
When other cameras already have detections, DIVE prompts before launch:

- **No** / **Continue** (separate) — remaps new TrackIds above every ID on the other cameras so IDs do not collide.
- **Yes** (associate) — only offered for calibrated stereo with interactive stereo features enabled. Runs VIAME association and **replaces annotations on both cameras** with the paired result.
- **Yes** (associate) — only offered for calibrated stereo with interactive stereo features enabled. Runs VIAME association and **replaces annotations on both cameras** with the paired result. Pairing works the way VIAME's stereo track-and-measure pipelines pair cameras: by head/tail keypoints where both cameras have them, and by box position against the stereo geometry otherwise; a track's classes are kept as its own camera's pipeline produced them.

When association is unavailable (plain multicam, missing calibration, or stereo features off), the dialog explains why and only offers separate-ID remapping.

Expand Down
8 changes: 6 additions & 2 deletions server/dive_tasks/single_camera_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ def association_pipeline():
process pairing
:: compute_measurements
:matching_methods input_pairs_only
:detection_pairing_method calibration
:detection_pairing_threshold 10
:calibration_file calibration.json
:min_track_states 0
:detection_pairing_method keypoint_projection,calibration
:detection_pairing_threshold 50.0
:detection_pairing_require_class_match false
:max_stereo_rms 20.0
:max_bbox_area_ratio 3.0
:accumulate_track_pairings true
:pairing_resolution_method most_likely
:detection_split_threshold 1
Expand Down
16 changes: 16 additions & 0 deletions server/tests/test_single_camera_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,19 @@ def test_real_stereo_association(tmp_path):
unmatched = [row[0] for row in left + right if 'crab' in row or 'shark' in row]
assert len(set(unmatched)) == 2
assert set(unmatched).isdisjoint({row[0] for row in left_fish})


def test_worker_pairing_settings_match_desktop():
desktop = (
Path(__file__).parents[2] / 'client/dive-common/singleCamera/association.ts'
).read_text()

def pairing_settings(pipeline):
pairing = pipeline.split('process pairing', 1)[1].split('connect from', 1)[0]
return dict(
line.strip()[1:].split(None, 1)
for line in pairing.splitlines()
if line.strip().startswith(':') and not line.strip().startswith('::')
)

assert pairing_settings(module.association_pipeline()) == pairing_settings(desktop)
Loading