Skip to content

Initial Stereo/MultiCam Support Commit#803

Merged
BryonLewis merged 8 commits intomainfrom
desktop/stereo-init
Jul 1, 2021
Merged

Initial Stereo/MultiCam Support Commit#803
BryonLewis merged 8 commits intomainfrom
desktop/stereo-init

Conversation

@BryonLewis
Copy link
Collaborator

@BryonLewis BryonLewis commented Jun 10, 2021

I broke up the massive PR into smaller ones.

  • This begins with allowing upload of stereo data and running of the latest stereo pipeline.
  • It treats each folder as it's own dataset and modifies some of the subType and metadata to make it easier to filter.
  • As of now the only view is the default camera view chosen at the beginning and it behaves like the main multicamera view so you can only the measurement pipeline on it
  • If you run the main stereo pipeline you will get results. If you check project folder for each camera you should see JSON files for each camera's results.
  • I updated the processing of annotations after a pipeline to include the suggested attributes so they will display properly in the UI. This is how you get measurements back.

This is laying the foundation for being able to display the multicamera view as well as import annotation files through the UI.

After this I think I would be overhauling the import dialog so allow for individual annotation files per camera and I think I may want to have a discussion about import Dialogs and what we want to use.

@BryonLewis BryonLewis requested review from f4str and subdavis June 11, 2021 16:49
@f4str
Copy link

f4str commented Jun 11, 2021

I found a minor UI bug where the buttons are different sizes
image
Looks like if the width is between ~1000px and ~1200px this happen.

I might be nitpicking here, but it didn't seem very intuitive when I got to this popup box for importing multicam
image
It took a second to realize you need to submit a name then you get the choose file prompt. It might just be me though.

Other than that, everything else ran just fine on my end.

@BryonLewis
Copy link
Collaborator Author

It took a second to realize you need to submit a name then you get the choose file prompt. It might just be me though.

You're right, combination of (in my opinion) the bad text input default style of vuetify elements and me becoming complacent after testing it a bunch.

@BryonLewis
Copy link
Collaborator Author

@f4str - thoughts?
Gave the button a description and used the outlined version of the folder/name fields to make it more clear that it is a text input area.
image

image

@f4str
Copy link

f4str commented Jun 15, 2021

I think that looks a lot better. It's a lot more intuitive now that you need to set a camera name first before uploading any images/videos.

f4str
f4str previously approved these changes Jun 15, 2021
Copy link

@f4str f4str left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@aashish24
Copy link
Collaborator

expected date for merge: June 29th as per our discussions

Copy link
Contributor

@subdavis subdavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have just a little more to look at (multiCamUtils.ts) but I keep getting distracted and I want to throw this over the fence.

imageData: FrameImage[];
videoUrl: string;
}>;
display: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment what this is. Also note if it will be removed once there's true multi-cam support?

display: string;
}

interface CustomMediaImportPayload {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document what this is. Also, I tend to think of "Payload" as an import. Could we rename this to "MediaImportResponse" or something? I'm not sure "Custom" adds any meaning.


type DatasetType = 'image-sequence' | 'video';
type MultiTrackRecord = Record<string, TrackData>;
type SubType = 'stereo' | 'multicam' | null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"DatasetType" and "SubType" seem backwards as names?

A dataset could be stereo, multicam, or normal. Each camera can have a subtype image-sequence or video?

Perhaps subType should be DatasetType and DatasetType should be MediaType?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dataset is image-sequence | video | multi - I didn't add the multi to the common/apispec because it isn't supported on the Web side yet. I could add it but it would require some updating to other files outside of the desktop scope to support it. Maybe I should place a comment here?

So I could see having DatasetType renamed to MediaType where it has image-sequence | video | multi(desktop only) I think I would want to rename it on the Server backend in python as well at the same time (a lot more files touched).

SubType may more accurately be renamed as multiCamType? There are differences in pipelines than can only be run based on the subType. Stereo only pipelines vs Multicam only pipelines. This allows me to disable/enable pipelines without having to reach far down into the meta and create a computed property (especially in the future folder view on web). I could move this into camera object although we may want to use this same field for for future identification of specialized media outside of MultiCam subtypes. Like IR images may have special pipelines on them and can be designated using this field.

The secondary use of it is inside of the JSONMeta for the displaying of the icon indicating that the dataset is stereo (binocular icon) or multicam (burst image icon).

So I can move it into the camera field and remove the icon display capability in recents because I wouldn't know the type until I load the fully metadata Or I could rename it to something like multiCamSubType or multiCamType.

type: Object,
default: () => ({}),
},
subTypeList: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mediaTypeList?

Comment on lines 250 to 252
// const allowedPatterns = /^detector_.+|^tracker_.+|^generate_.+|^utility_|^measurement\.gmm/;
// Disable measurement for now.
const allowedPatterns = /^detector_.+|^tracker_.+|^generate_.+|^utility_/;
const allowedPatterns = /^detector_.+|^tracker_.+|^generate_.+|^utility_|^measurement_gmm_.+/;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the comments above?

if (!recent.multiCam) {
if (recent.type === 'video') {
return 'mdi-file-video';
if (recent.type === 'multi') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you be checking subType here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right below that I check the subType if it is of type multi to either display the binoculars or the burst photos.

Comment on lines 25 to 26
transcodedImageFiles?: string[];
transcodedVideoFile?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: in DatasetMeta, the transcoded media keys are not nullable, they're empty string and empty array if unused. For consistency (and my poor brain) it would be nice if these matched.

command.push(`-s ${arg}="${file}"`);
});
multiOutFiles = {};
Object.entries(outFiles).forEach(([key, val]) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key val => cameraName, fileName

let destLoc = '';
if (jsonMeta.multiCam) {
let breakFlag = false;
Object.entries(jsonMeta.multiCam.cameras).forEach(([key, val]) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key, val => cameraName, camera ?

Comment on lines 17 to 18
let breakFlag = false;
Object.entries(jsonMeta.multiCam.cameras).forEach(([key, val]) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use forEach proto method in loops you need to break from, prefer for...of and break keyword

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be done but ESLint gets upset and requires // eslint-disable-next-line no-restricted-syntax mostly because it doesn't want you to use a for of like that. I think the for...of is cleaner than the break flag I was using which was causing additional iterations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also usually forget that for...of and for...in require RegeneratorRuntime, which I avoid like the plague.

You might just need a regular for loop here?

@subdavis subdavis self-requested a review June 30, 2021 01:12
Copy link
Contributor

@subdavis subdavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semi-populated form issue

When you start to work on a multi-cam import, and you create some named cameras, then you switch to keyword filter, you end up in a weird state where both exist. Same happens for stereo and multi.
Screenshot from 2021-06-29 21-19-34
Screenshot from 2021-06-29 21-17-11

Stereo requires calibration file (no change requested)

I'm not totally sure if it should. I understand that the stereo pipeline requires it, but maybe that should be an error thrown when the pipeline runs? Will anyone want to use stereo without the calibration file?
I think this is fine to leave alone as well, just wanted to leave a breadcrumb about this
Screenshot from 2021-06-29 21-18-16

@subdavis subdavis self-requested a review July 1, 2021 00:51
@BryonLewis BryonLewis merged commit bae90aa into main Jul 1, 2021
@subdavis subdavis deleted the desktop/stereo-init branch July 1, 2021 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants