Skip to content
Merged
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
5 changes: 1 addition & 4 deletions client/dive-common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,13 @@ const zipFileTypes = [
'zip',
];

const stereoPipelineMarker = 'measurement';
const stereoPipelineMarker = 'stereo';
/** Girder item meta key marking the original stereoscopic calibration upload (pipeline input). */
const calibrationFileMarker = 'calibrationFile';
/** Girder item meta key marking the JSON camera-rig used for calibration display. */
const jsonCalibrationFileMarker = 'jsonCalibrationFile';
/** Girder item meta key marking a frame-metadata attachment for Girder UI. */
const frameMetadataFileMarker = 'frameMetadata';
/** Legacy common_stereo category key; never shown in the run-pipeline menu. */
const hiddenPipelineCategories = ['stereo'];
/** Pipeline name/category substrings hidden from the web run-pipeline menu. */
const webExcludedPipelineTerms = ['seagis'];
const multiCamPipelineMarkers = ['2-cam', '3-cam'];
Expand Down Expand Up @@ -285,7 +283,6 @@ export {
calibrationFileMarker,
jsonCalibrationFileMarker,
frameMetadataFileMarker,
hiddenPipelineCategories,
webExcludedPipelineTerms,
multiCamPipelineMarkers,
pipelineCreatesDatasetMarkers,
Expand Down
4 changes: 2 additions & 2 deletions client/dive-common/pipelineCalibration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import type { Pipe } from './apispec';
describe('pipelineCalibration', () => {
const measurementPipe: Pipe = {
name: 'gmm',
type: 'measurement',
pipe: 'measurement_gmm.pipe',
type: 'stereo',
pipe: 'stereo_gmm.pipe',
};

it('requires calibration when metadata flag is true', () => {
Expand Down
12 changes: 6 additions & 6 deletions client/dive-common/pipelineCreatesDataset.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ describe('pipelineCreatesNewDataset', () => {

it('matches the rectified disparity measurement pipe', () => {
expect(pipelineCreatesNewDataset({
type: 'measurement',
pipe: 'measurement_compute_rectified_disparity.pipe',
type: 'stereo',
pipe: 'stereo_compute_rectified_disparity.pipe',
})).toBe(true);
});

it('does not match ordinary detector/tracker/measurement pipes', () => {
expect(pipelineCreatesNewDataset({ type: '2-cam', pipe: 'detector_2-cam.pipe' })).toBe(false);
expect(pipelineCreatesNewDataset({ type: 'detector', pipe: 'detector_default.pipe' })).toBe(false);
expect(pipelineCreatesNewDataset({
type: 'measurement',
pipe: 'measurement_gmm_left_right_stereo.pipe',
type: 'stereo',
pipe: 'stereo_gmm_left_right_stereo.pipe',
})).toBe(false);
});
});
Expand Down Expand Up @@ -75,10 +75,10 @@ describe('isTranscodePipeline', () => {
describe('isDisparityImagePipeline', () => {
it('matches only the rectified disparity pipe', () => {
expect(isDisparityImagePipeline({
pipe: 'measurement_compute_rectified_disparity.pipe',
pipe: 'stereo_compute_rectified_disparity.pipe',
})).toBe(true);
expect(isDisparityImagePipeline({
pipe: 'measurement_gmm_left_right_stereo.pipe',
pipe: 'stereo_gmm_left_right_stereo.pipe',
})).toBe(false);
});
});
4 changes: 2 additions & 2 deletions client/dive-common/pipelineCreatesDataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Pipe } from 'dive-common/apispec';
import { pipelineCreatesDatasetMarkers } from 'dive-common/constants';

/** Stereo pipe that writes disparity/depth images as a new image-sequence dataset. */
export const DISPARITY_IMAGE_PIPELINE = 'measurement_compute_rectified_disparity.pipe';
export const DISPARITY_IMAGE_PIPELINE = 'stereo_compute_rectified_disparity.pipe';

/**
* True when a pipeline produces a new dataset (filter / transcode / disparity).
Expand Down Expand Up @@ -32,7 +32,7 @@ export function isTranscodePipeline(pipeline: Pick<Pipe, 'type' | 'pipe'>): bool
}

/**
* True for measurement_compute_rectified_disparity.pipe — produces depth-map
* True for stereo_compute_rectified_disparity.pipe — produces depth-map
* images that should become a new dataset (not CSV annotations).
*/
export function isDisparityImagePipeline(pipeline: Pick<Pipe, 'pipe'>): boolean {
Expand Down
26 changes: 9 additions & 17 deletions client/dive-common/pipelineMenuFilters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import {
import type { Pipelines } from './apispec';

const samplePipelines: Pipelines = {
measurement: { description: '', pipes: [{ name: 'gmm', type: 'measurement', pipe: 'measurement_gmm.pipe' }] },
stereo: { description: '', pipes: [{ name: 'gmm', type: 'stereo', pipe: 'stereo_gmm.pipe' }] },
'2-cam': { description: '', pipes: [{ name: 'detector', type: '2-cam', pipe: 'detector_2-cam.pipe' }] },
'3-cam': { description: '', pipes: [{ name: 'detector', type: '3-cam', pipe: 'detector_3-cam.pipe' }] },
detector: { description: '', pipes: [{ name: 'default', type: 'detector', pipe: 'detector_default.pipe' }] },
stereo: { description: '', pipes: [{ name: 'fish tracker', type: 'stereo', pipe: 'common_stereo_fish_tracker.pipe' }] },
};

describe('pipelineMenuFilters', () => {
Expand All @@ -27,24 +26,17 @@ describe('pipelineMenuFilters', () => {
})).toBe(3);
});

it('hides measurement and multicam categories when subTypeList is empty', () => {
it('hides stereo and multicam categories when subTypeList is empty', () => {
const filtered = filterPipelinesForDatasets(samplePipelines, [], [1]);
expect(filtered.measurement).toBeUndefined();
expect(filtered.stereo).toBeUndefined();
expect(filtered['2-cam']).toBeUndefined();
expect(filtered['3-cam']).toBeUndefined();
expect(filtered.detector).toBeDefined();
});

it('never shows legacy common_stereo category', () => {
it('shows stereo only for all-stereo selection', () => {
const filtered = filterPipelinesForDatasets(samplePipelines, ['stereo'], [2]);
expect(filtered.stereo).toBeUndefined();
expect(filtered.measurement).toBeDefined();
});

it('shows measurement only for all-stereo selection', () => {
const filtered = filterPipelinesForDatasets(samplePipelines, ['stereo'], [2]);
expect(filtered.measurement).toBeDefined();
expect(filtered.stereo).toBeDefined();
expect(filtered['2-cam']).toBeUndefined();
expect(filtered.detector).toBeDefined();
});
Expand Down Expand Up @@ -82,7 +74,7 @@ describe('pipelineMenuFilters', () => {

it('hides special categories for non-multicam subtypes', () => {
const filtered = filterPipelinesForDatasets(samplePipelines, [null], [1]);
expect(filtered.measurement).toBeUndefined();
expect(filtered.stereo).toBeUndefined();
expect(filtered['2-cam']).toBeUndefined();
expect(filtered.detector).toBeDefined();
});
Expand Down Expand Up @@ -116,17 +108,17 @@ describe('pipelineMenuFilters', () => {
expect(filtered.detector).toBeDefined();
});

it('orders categories detector, tracker, measurement, filter, transcode, utility, trained', () => {
it('orders categories detector, tracker, stereo, filter, transcode, utility, trained', () => {
const pipelines: Pipelines = {};
['trained', 'utility', 'filter', 'zeta', 'transcode', 'tracker', 'measurement', 'alpha', 'detector']
['trained', 'utility', 'filter', 'zeta', 'transcode', 'tracker', 'stereo', 'alpha', 'detector']
.forEach((name) => { pipelines[name] = { description: '', pipes: [] }; });
expect(Object.keys(orderPipelineCategories(pipelines))).toEqual([
'detector', 'tracker', 'measurement', 'filter', 'transcode', 'utility', 'trained', 'zeta', 'alpha',
'detector', 'tracker', 'stereo', 'filter', 'transcode', 'utility', 'trained', 'zeta', 'alpha',
]);
});

it('orders categories in filterPipelinesForDatasets', () => {
const filtered = filterPipelinesForDatasets(samplePipelines, ['stereo'], [2]);
expect(Object.keys(filtered)).toEqual(['detector', 'measurement']);
expect(Object.keys(filtered)).toEqual(['detector', 'stereo']);
});
});
10 changes: 4 additions & 6 deletions client/dive-common/pipelineMenuFilters.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Pipe, Pipelines, SubType } from 'dive-common/apispec';
import {
MultiType,
hiddenPipelineCategories,
multiCamPipelineMarkers,
stereoPipelineMarker,
} from 'dive-common/constants';
Expand Down Expand Up @@ -51,7 +50,7 @@ function shouldShowMultiCamPipelineCategory(
if (!cameraNumbers.every((count) => count === expectedCameras)) {
return false;
}
// Stereoscopic datasets use measurement pipelines, not X-cam categories.
// Stereoscopic datasets use stereo pipelines, not X-cam categories.
if (subTypeList.some((item) => item === 'stereo')) {
return false;
}
Expand Down Expand Up @@ -97,7 +96,7 @@ export function excludePipelinesMatchingTerms(
/**
* Filter pipeline categories for the run-pipeline menu (matches desktop behavior).
*
* - measurement: only when every selected dataset is stereoscopic
* - stereo: only when every selected dataset is stereoscopic
* - 2-cam / 3-cam: only when every selected dataset is multicam and all share that camera count
* - other categories: always shown (except the special categories above when not applicable)
*/
Expand Down Expand Up @@ -126,8 +125,7 @@ export function filterPipelinesForDatasets(
&& shouldShowMultiCamPipelineCategory(name, subTypeList, cameraNumbers, datasetTypes)) {
sortedPipelines[name] = category;
}
if (!hiddenPipelineCategories.includes(name)
&& name !== stereoPipelineMarker
if (name !== stereoPipelineMarker
&& !multiCamPipelineMarkers.includes(name)) {
sortedPipelines[name] = category;
}
Expand All @@ -140,7 +138,7 @@ export function filterPipelinesForDatasets(

/** Menu order for known categories; anything else keeps its discovery order after them. */
export const pipelineCategoryOrder = [
'detector', 'tracker', 'measurement', 'filter', 'transcode', 'utility', 'generate', 'trained',
'detector', 'tracker', 'stereo', 'filter', 'transcode', 'utility', 'generate', 'trained',
];

export function orderPipelineCategories(pipelines: Pipelines): Pipelines {
Expand Down
4 changes: 2 additions & 2 deletions client/dive-common/pipelineTypeDisplay.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pipelineTypeDisplay from './pipelineTypeDisplay';

describe('pipelineTypeDisplay', () => {
it('labels measurement category', () => {
expect(pipelineTypeDisplay('measurement')).toBe('Measurement');
it('labels stereo category', () => {
expect(pipelineTypeDisplay('stereo')).toBe('Stereo');
});

it('pluralizes other category keys', () => {
Expand Down
4 changes: 2 additions & 2 deletions client/dive-common/pipelineTypeDisplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default function pipelineTypeDisplay(pipeType: string): string {
return 'utilities';
case 'transcode':
return 'transcoders';
case 'measurement':
return 'Measurement';
case 'stereo':
return 'Stereo';
default:
return `${pipeType}s`;
}
Expand Down
2 changes: 1 addition & 1 deletion client/platform/desktop/backend/native/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ async function autodiscoverData(settings: Settings): Promise<JsonConfig[]> {
*/
async function getPipelineList(settings: Settings): Promise<Pipelines> {
const pipelinePath = npath.join(settings.viamePath, 'configs/pipelines');
const allowedPatterns = /^filter_.+|^transcode_.+|^detector_.+|^tracker_.+|^generate_.+|^utility_|^measurement_.+|.*[2,3]-cam.+/;
const allowedPatterns = /^filter_.+|^transcode_.+|^detector_.+|^tracker_.+|^generate_.+|^utility_|^stereo_.+|.*[2,3]-cam.+/;
const disallowedPatterns = /.*local.*|common_stereo_.*|detector_svm_models.pipe|tracker_svm_models.pipe/;
const exists = await fs.pathExists(pipelinePath);
if (!exists) return {};
Expand Down
4 changes: 2 additions & 2 deletions client/platform/desktop/backend/native/viame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,11 @@ async function runPipeline(
const joblog = npath.join(jobWorkDir, 'runlog.txt');

//TODO: TEMPORARY FIX FOR DEMO PURPOSES
// Disparity image pipe is measurement_* but only needs stereo media + calibration.
// Disparity image pipe is stereo_* but only needs stereo media + calibration.
let requiresInput = false;
if (
!isDisparityPipe
&& (/utility_|filter_|transcode_|measurement_/g).test(pipeline.pipe)
&& (/utility_|filter_|transcode_|stereo_/g).test(pipeline.pipe)
) {
requiresInput = true;
}
Expand Down
4 changes: 2 additions & 2 deletions server/dive_tasks/multicam_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from dive_utils import constants
from dive_utils.types import MulticamCameraJob, MulticamRegistrationJob, PipelineDescription

_PIPELINE_INPUT_PATTERN = re.compile(r'utility_|filter_|transcode_|measurement_')
_PIPELINE_INPUT_PATTERN = re.compile(r'utility_|filter_|transcode_|stereo_')
_PSEUDO_FRAME_PATTERN = re.compile(r'^frame://(\d+)$')


Expand Down Expand Up @@ -110,7 +110,7 @@ def extract_video_frames(

def pipeline_requires_input(pipeline: PipelineDescription) -> bool:
"""True when the pipe needs existing detections/tracks as input (matches desktop)."""
# Disparity image pipe is measurement_* but only needs stereo media + calibration.
# Disparity image pipe is stereo_* but only needs stereo media + calibration.
if is_disparity_image_pipeline(pipeline):
return False
return bool(_PIPELINE_INPUT_PATTERN.search(pipeline['pipe']))
Expand Down
4 changes: 2 additions & 2 deletions server/dive_tasks/pipeline_creates_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
PIPELINE_CREATES_DATASET_MARKERS = ('transcode', 'filter')

# Stereo pipe that writes disparity/depth images as a new image-sequence dataset.
DISPARITY_IMAGE_PIPELINE = 'measurement_compute_rectified_disparity.pipe'
DISPARITY_IMAGE_PIPELINE = 'stereo_compute_rectified_disparity.pipe'


def is_disparity_image_pipeline(pipeline: PipelineDescription) -> bool:
"""True for measurement_compute_rectified_disparity.pipe."""
"""True for stereo_compute_rectified_disparity.pipe."""
return pipeline.get('pipe') == DISPARITY_IMAGE_PIPELINE


Expand Down
2 changes: 1 addition & 1 deletion server/dive_tasks/pipeline_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# Align with desktop getPipelineList allow patterns (common.ts).
AllowedStaticPipelines = (
r"^filter_.+|^transcode_.+|^detector_.+|^tracker_.+|^generate_.+|^utility_.+|"
r"^measurement_.+|.*[23]-cam.+"
r"^stereo_.+|.*[23]-cam.+"
)

DisallowedStaticPipelines = (
Expand Down
2 changes: 1 addition & 1 deletion server/dive_utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@

# Other constants
TrainedPipelineCategory = "trained"
StereoPipelineMarker = "measurement"
StereoPipelineMarker = "stereo"
MultiCamPipelineMarkers = ("2-cam", "3-cam")

# The name of the folder where any user specific data should be stored
Expand Down
4 changes: 2 additions & 2 deletions server/tests/test_create_multicam.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def test_resolve_stereo_calibration_item_id_from_folder_root(item_cls):
pipeline = {
'name': 'Stereo',
'type': constants.StereoPipelineMarker,
'pipe': 'measurement_foo.pipe',
'pipe': 'stereo_foo.pipe',
'metadata': {'requiresCalibration': True},
}
cal_item = {
Expand Down Expand Up @@ -464,7 +464,7 @@ def test_resolve_stereo_calibration_item_id_legacy_multi_cam_id(item_cls):
pipeline = {
'name': 'Stereo',
'type': constants.StereoPipelineMarker,
'pipe': 'measurement_foo.pipe',
'pipe': 'stereo_foo.pipe',
'metadata': {'requiresCalibration': True},
}
cal_item = {
Expand Down
8 changes: 4 additions & 4 deletions server/tests/test_multicam_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ def test_pipeline_requires_input():
{
'name': 'disparity',
'type': constants.StereoPipelineMarker,
'pipe': 'measurement_compute_rectified_disparity.pipe',
'pipe': 'stereo_compute_rectified_disparity.pipe',
}
)
assert pipeline_requires_input(
{
'name': 'meas',
'type': constants.StereoPipelineMarker,
'pipe': 'measurement_gmm_left_right_stereo.pipe',
'pipe': 'stereo_gmm_left_right_stereo.pipe',
}
)

Expand All @@ -54,7 +54,7 @@ def test_is_stereo_or_multicam_pipeline():

def test_is_stereo_measurement_pipeline():
assert is_stereo_measurement_pipeline(
{'name': 'm', 'type': constants.StereoPipelineMarker, 'pipe': 'measurement_x.pipe'}
{'name': 'm', 'type': constants.StereoPipelineMarker, 'pipe': 'stereo_x.pipe'}
)
assert not is_stereo_measurement_pipeline({'name': '2', 'type': '2-cam', 'pipe': 'x.pipe'})

Expand Down Expand Up @@ -87,7 +87,7 @@ def test_append_stereo_calibration_kwiver_settings_declared_keys():
pipeline = {
'name': 'disparity',
'type': constants.StereoPipelineMarker,
'pipe': 'measurement_compute_rectified_disparity.pipe',
'pipe': 'stereo_compute_rectified_disparity.pipe',
'metadata': {
'calibrationKeys': [
'depth_map:computer:ocv_stereo_disparity:calibration_file',
Expand Down
8 changes: 4 additions & 4 deletions server/tests/test_pipeline_creates_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ def test_pipeline_creates_new_dataset_disparity():
{
'name': 'd',
'type': constants.StereoPipelineMarker,
'pipe': 'measurement_compute_rectified_disparity.pipe',
'pipe': 'stereo_compute_rectified_disparity.pipe',
}
)
assert not pipeline_creates_new_dataset(
{
'name': 'm',
'type': constants.StereoPipelineMarker,
'pipe': 'measurement_gmm_left_right_stereo.pipe',
'pipe': 'stereo_gmm_left_right_stereo.pipe',
}
)
assert not pipeline_creates_new_dataset(
Expand All @@ -65,13 +65,13 @@ def test_is_filter_transcode_disparity_helpers():
{
'name': 'd',
'type': constants.StereoPipelineMarker,
'pipe': 'measurement_compute_rectified_disparity.pipe',
'pipe': 'stereo_compute_rectified_disparity.pipe',
}
)
assert not is_disparity_image_pipeline(
{
'name': 'm',
'type': constants.StereoPipelineMarker,
'pipe': 'measurement_other.pipe',
'pipe': 'stereo_other.pipe',
}
)
Loading
Loading