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

Dev/adjust tcn coco saving #460

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions angel_system/activity_classification/tcn_hpl/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,19 +464,30 @@ def collect(
raise RuntimeError(
"No video set before results collection. See `set_video` method."
)
packet = dict(
# get the global id for the image from the frame number

# add the image
img = dict(
video_id=self._vid,
frame_index=frame_index,
activity_pred=activity_pred,
activity_conf=list(activity_conf_vec),
)
if name is not None:
packet["name"] = name
img["name"] = name
if file_name is not None:
packet["file_name"] = file_name
img["file_name"] = file_name
if activity_gt is not None:
packet["activity_gt"] = activity_gt
self._dset.add_image(**packet)
img["activity_gt"] = activity_gt
josephvanpeltkw marked this conversation as resolved.
Show resolved Hide resolved
# save the gid from the image to link to the annot
gid = self._dset.add_image(**img)

# additional items to save
add_items = dict(
prob=list(activity_conf_vec),
)
josephvanpeltkw marked this conversation as resolved.
Show resolved Hide resolved
# add the annotation
self._dset.add_annotation(
image_id=gid, category_id=activity_pred, **add_items
)

def write_file(self):
"""
Expand Down
Loading