Skip to content

Refactor/detections fetching#618

Merged
subdavis merged 7 commits into
mainfrom
refactor/detections-fetching
Mar 11, 2021
Merged

Refactor/detections fetching#618
subdavis merged 7 commits into
mainfrom
refactor/detections-fetching

Conversation

@subdavis
Copy link
Copy Markdown
Contributor

@subdavis subdavis commented Mar 5, 2021

Refactor the sorta messy girder queries for detection items because they're getting copy-pasted all over.

Don't really want to block #590, so will rebase on main after it merges.

@subdavis subdavis changed the base branch from pipeline-existing-detections to main March 8, 2021 17:33
@subdavis subdavis changed the base branch from main to pipeline-existing-detections March 8, 2021 17:33
@subdavis subdavis force-pushed the refactor/detections-fetching branch from 3320ca2 to 1fe4c02 Compare March 8, 2021 17:35
@subdavis subdavis changed the base branch from pipeline-existing-detections to main March 8, 2021 17:35
@subdavis subdavis requested a review from BryonLewis March 8, 2021 17:39
@subdavis subdavis marked this pull request as ready for review March 8, 2021 17:39
Copy link
Copy Markdown
Collaborator

@BryonLewis BryonLewis left a comment

Choose a reason for hiding this comment

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

couple items to look at

Comment thread server/dive_server/utils.py Outdated
item = detections_item(folder, strict)
if item is None and not strict:
return None
return Item().childFiles(item[0])[0]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

in detections_item() you already return all_items[0] so I think this might be an index into something that doesn't exist?

Comment thread server/dive_server/utils.py Outdated
Comment on lines +24 to +25
all_items = all_detections_items(folder)
detection = all_items[0] if all_items else None
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

all_detection_items can return an empty Cursor object which is still true. This is the case if you upload media with no source csv detections. This could also be the case if the detections were removed from the girder folder manually so there was no return value.
something like all_items[0] if all_items.count() > 0 else None may work?

@subdavis subdavis force-pushed the refactor/detections-fetching branch from 07ca748 to 92eb4fb Compare March 11, 2021 19:43
Copy link
Copy Markdown
Collaborator

@BryonLewis BryonLewis left a comment

Choose a reason for hiding this comment

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

Very minor thing with variable name.

Comment thread server/dive_server/viame.py Outdated
Comment on lines +265 to +267
detections_json_item = detections_item(folder, strict=True)
ensure_csv_detections_file(folder, detections_json_item, user)
detection_list.append(detections_json_item)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Little confusing at first glance because we are using a json named ITEM to store both the json and the csv. This detection_json_item could already have an attached csv. I don't believe we assigned detection metadata to any csv's anymore so all detection_items at least have a json file? Maybe favor using detection_item here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did this just because the name of the function was so similar to the variable that it was a readability issue. Changed to train_on_detections_item, is that OK?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah I completely forgot that would be a similar name to the function.

@BryonLewis BryonLewis self-requested a review March 11, 2021 22:06
@subdavis subdavis merged commit 572c34a into main Mar 11, 2021
@subdavis subdavis deleted the refactor/detections-fetching branch March 11, 2021 22:09
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.

2 participants