Skip to content
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

Attaching the timestamp to each trash, and not to each box #7

Closed
bertrandlalo opened this issue May 1, 2020 · 2 comments
Closed

Attaching the timestamp to each trash, and not to each box #7

bertrandlalo opened this issue May 1, 2020 · 2 comments
Assignees
Labels
invalid This doesn't seem right

Comments

@bertrandlalo
Copy link
Collaborator

etl/etl/utils/ai.py

Lines 138 to 147 in 159be3e

detected_trashes.loc[:, "box"] = np.apply_along_axis(
lambda frame_to_box: str(list(frame_to_box[0].values())[0]),
axis=1,
arr=detected_trashes[["frame_to_box"]].values,
)
detected_trashes.loc[:, "frame"] = np.apply_along_axis(
lambda frame_to_box: int(list(frame_to_box[0].keys())[0]),
axis=1,
arr=detected_trashes[["frame_to_box"]].values,
)

See discussion with Charles here:
you may (and it happens often) have a single detected trash that is found in mutliple consecutive frames (1 trash = several boxes), for instance:

{'detected_trash': [
                    {'frame_to_box': {'2': [0.43, 0.44, 0.49, 0.5], '3':[0.42, 0.44, 0.48, 0.5]},
                       'id': 0,
                       'label': 'fragments'}
}

I suggest attaching the timestamp to each trash, and not to each box. The timestamp of the trash should then be the average of the timestamps of the frames with boxes detected (in the example above, (timestamp of frame 2 + timestamp of frame 3)/2).

surfriderfoundationeurope/mot#35

@bertrandlalo bertrandlalo added the bug Something isn't working label May 1, 2020
@bertrandlalo bertrandlalo self-assigned this May 1, 2020
@bertrandlalo bertrandlalo added invalid This doesn't seem right and removed bug Something isn't working labels May 1, 2020
@bertrandlalo
Copy link
Collaborator Author

This should fix it :

62c1c75

I suggest two ways of identifying the more relevant frame for the trash to be chosen as a reference :

  • either the one where box area is the larger (assuming the trash hence is nearer from the kayak's location)
  • or (what we discussed yesterday), the frame in the middle (in time).
    What do you think @AntoineBruge , @cl3m3nt ?

Actually, I thought of this alternative because I was wondering what we should do if we have frame 1, 2, 3, 24, 25 (for example, user turns gopro around or kayak goes back and forth..)
I may go have a look on how MOT handles the tracking to have my answer :)

@bertrandlalo bertrandlalo linked a pull request May 3, 2020 that will close this issue
@cl3m3nt
Copy link
Contributor

cl3m3nt commented Mar 8, 2021

Reviewed

@cl3m3nt cl3m3nt closed this as completed Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants