-
Notifications
You must be signed in to change notification settings - Fork 23
Labels.txt Upload #1072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels.txt Upload #1072
Conversation
subdavis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Two main comments:
- When you add new optional parameters to a method, I think it's best to add them at the end rather than in the middle. It breaks the previous API unnecessarily, and if you add them at the end, you don't risk creating a bug somewhere that you forgot to update the function call.
- I think the text argument needs to be added into the request body (comment below)
client/dive-common/apispec.ts
Outdated
| import { CustomStyle } from 'vue-media-annotator/use/useStyling'; | ||
|
|
||
| type DatasetType = 'image-sequence' | 'video' | 'multi'; | ||
| type DatasetType = 'image-sequence' | 'video' | 'multi' | 'txt'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'txt' shouldn't be a dataset type. This is like an image sequence, a video, or a multi-camera dataset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set now
client/dive-common/apispec.ts
Outdated
| folderIds: string[], pipelineName: string, config: string, annotatedFramesOnly: boolean | ||
| folderIds: string[], | ||
| pipelineName: string, | ||
| labelText: string | null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional params should probably move to the end of the method and become labelText?: string
If you make it a new optional param at the end, the API spec will be backward compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set now
client/dive-common/constants.ts
Outdated
| [ImageSequenceType]: 'image sequence', | ||
| [VideoType]: 'video', | ||
| [MultiType]: 'multi', | ||
| [TxtType]: 'txt', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you want to modify MediaTypes at all for this feature. No new dataset types are being added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set now
client/dive-common/constants.ts
Outdated
| const ImageSequenceType = 'image-sequence'; | ||
| const VideoType = 'video'; | ||
| const MultiType = 'multi'; | ||
| const TxtType = 'txt'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set now
server/dive_tasks/tasks.py
Outdated
| source_folder_list: List[GirderModel], | ||
| groundtruth_list: List[GirderModel], | ||
| pipeline_name: str, | ||
| label_text:str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be an optional param and move to the end:
label_text: Optional[str] = None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set now
| if (dataset.value === null) return null; | ||
| const { type } = dataset.value; | ||
| if (type === MultiType) throw new Error('Cannot export multicamera dataset'); | ||
| if (type === TxtType) throw new Error('Cannot export txt dataset'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set now
server/dive_server/crud_rpc.py
Outdated
| newjob.job[constants.JOBCONST_PRIVATE_QUEUE] = job_is_private | ||
| newjob.job[constants.JOBCONST_TRAINING_INPUT_IDS] = folderIds | ||
| newjob.job[constants.JOBCONST_RESULTS_FOLDER_ID] = str(results_folder['_id']) | ||
| newjob.job[constants.JOBCONST_LABEL_TEXT] = labelText |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI, these meta values aren't really used for anything. They're here because we thought it would be better to have this information than not. No need to change, though.
| <v-file-input | ||
| v-if="labelText" | ||
| v-model="labelFile" | ||
| clearable | ||
| /> | ||
| <import-button | ||
| name="Upload labels.txt File" | ||
| icon="mdi-folder-open" | ||
| open-type="txt" | ||
| class="grow" | ||
| @open="openTxt" | ||
| /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two notes:
- Is the import button necessary, or could we just use the
v-file-inputhere? In other places in the app where file inputs are expected (Such as annotation file during import) only thev-file-inputis used. - I don't think it's clear to the user what this is or that it's optional. Perhaps we need a short description and a link to documentation. I don't think matt has written any documentation about this file, so we should probably add it somewhere in our docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed the UI to use v-file-input instead of the import button. This also removes the need to use the OpenFromDisk method.
I added the optional verbiage but I still don't feel I understand the contents of labels.txt file enough to provide meaningful documentation on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set now
| trainingOutputName.value = null; | ||
| } | ||
| const openTxt = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use async function function definition for consistency with line 60.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set now
| }; | ||
| reader.readAsText(data.fileList[0]); | ||
| // eslint-disable-next-line prefer-destructuring | ||
| labelFile.value = data.fileList[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| labelFile.value = data.fileList[0]; | |
| [labelFile.value] = data.fileList; |
This will resolve the eslint warning so you can remove the disable comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set now
BryonLewis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally agree that the datatype for datasets shouldn't be modified and that file-input should work fully.
This is just a note I believe about labels.txt from testing. The labels used have to be present in all training datasets I think? I was getting an error if they weren't. This is probably a question for Matt.
381c756 to
8839245
Compare
8839245 to
58dde9e
Compare
|
For the record I was calling the fact that I missed that linting issue silly, not that the rule existed. I don't have strong opinions about the rule but love the idea of black fixing it for us. |
BryonLewis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just asking about removing the 'txt' from openFromDisk if it is no longer being used.
Other than that it seems to load and run fine. I was able to get two pipelines trained which presented different results based on having a labels.txt to restrict the training vs letting it train with no labels.txt.
client/dive-common/apispec.ts
Outdated
| saveAttributes(datasetId: string, args: SaveAttributeArgs): Promise<unknown>; | ||
| // Non-Endpoint shared functions | ||
| openFromDisk(datasetType: DatasetType | 'calibration' | 'annotation' | 'text', directory?: boolean): | ||
| openFromDisk(datasetType: DatasetType | 'calibration' | 'annotation' | 'txt' | 'text', directory?: boolean): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary now that we are no longer using openFromDisk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set now
client/platform/web-girder/utils.ts
Outdated
| } else if (datasetType === 'txt') { | ||
| input.accept = inputTxtTypes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that txt is no longer being used is this necessary to keep in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are absolutely right, that can be removed now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set now
BryonLewis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took another look at stuff, only changes from last review should be that removal. As a precaution I pulled/built and ran integration testing as well as looked at some basic training results. Looks good to me.
|
I'd like to combine #1092 into this, and then this is good to go! |
* WIP * Update Pipeline-Documentation.md
subdavis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
Fixes #599
Currently on web platform only:
Adds ability for user to upload a labels.txt file via the training menu
If the file is present, writes to the temp directory and sends the file to viame with the run_training task