Skip to content

Commit

Permalink
Add filter and transcode pipelines (#1458)
Browse files Browse the repository at this point in the history
* Add filter and transcode pipelines to allowed patterns

* Add new pipe type for display

* Read input for filter and transcode pipelines
  • Loading branch information
jjnesbitt authored Dec 2, 2024
1 parent 6b66a28 commit a1f79a4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions client/dive-common/components/RunPipelineMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ export default defineComponent({
case 'utility':
case 'generate':
return 'utilities';
case 'transcode':
return 'transcoders';
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 @@ -344,7 +344,7 @@ async function autodiscoverData(settings: Settings): Promise<JsonMeta[]> {
*/
async function getPipelineList(settings: Settings): Promise<Pipelines> {
const pipelinePath = npath.join(settings.viamePath, 'configs/pipelines');
const allowedPatterns = /^detector_.+|^tracker_.+|^generate_.+|^utility_|^measurement_gmm_.+|.*[2,3]-cam.+/;
const allowedPatterns = /^filter_.+|^transcode_.+|^detector_.+|^tracker_.+|^generate_.+|^utility_|^measurement_gmm_.+|.*[2,3]-cam.+/;
const disallowedPatterns = /.*local.*|detector_svm_models.pipe|tracker_svm_models.pipe/;
const exists = await fs.pathExists(pipelinePath);
if (!exists) return {};
Expand Down
11 changes: 10 additions & 1 deletion client/platform/desktop/backend/native/viame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async function runPipeline(

//TODO: TEMPORARY FIX FOR DEMO PURPOSES
let requiresInput = false;
if ((/utility_/g).test(pipeline.pipe)) {
if ((/utility_|filter_|transcode_/g).test(pipeline.pipe)) {
requiresInput = true;
}
let groundTruthFileName;
Expand Down Expand Up @@ -126,6 +126,15 @@ async function runPipeline(
command.push(`-s track_writer:file_name="${trackOutput}"`);
}
}

if (runPipelineArgs.pipeline.type === 'filter') {
command.push(`-s kwa_writer:output_directory="${npath.join(jobWorkDir, 'output')}"`);
command.push(`-s image_writer:file_name_prefix="${jobWorkDir}/"`);
}
if (runPipelineArgs.pipeline.type === 'transcode') {
command.push(`-s video_writer:video_filename="${npath.join(jobWorkDir, `${datasetId}.mp4`)}"`);
}

if (requiresInput && !stereoOrMultiCam) {
command.push(`-s detection_reader:file_name="${groundTruthFileName}"`);
command.push(`-s track_reader:file_name="${groundTruthFileName}"`);
Expand Down

0 comments on commit a1f79a4

Please sign in to comment.