Skip to content

Commit

Permalink
Merge pull request #123 from ttngu207/main_external-storage
Browse files Browse the repository at this point in the history
feat: store output files from `analyze_videos()` as `filepath`
  • Loading branch information
MilagrosMarin authored Aug 20, 2024
2 parents d803249 + e41025d commit 79edc1d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions element_deeplabcut/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,14 @@ class BodyPartPosition(dj.Part):
likelihood : longblob
"""

class File(dj.Part):
definition = """
-> master
file_name: varchar(255)
---
file: filepath@dlc-processed
"""

def make(self, key):
""".populate() method will launch training for each PoseEstimationTask"""
# ID model and directories
Expand Down Expand Up @@ -835,6 +843,18 @@ def do_analyze_videos():

self.insert1({**key, "pose_estimation_time": creation_time})
self.BodyPartPosition.insert(body_parts)
# Insert result files
self.File.insert(
[
{
**key,
"file_name": f.relative_to(output_dir).as_posix(),
"file": f,
}
for f in output_dir.rglob("*")
if f.is_file()
]
)

@classmethod
def get_trajectory(cls, key: dict, body_parts: list = "all") -> pd.DataFrame:
Expand Down

0 comments on commit 79edc1d

Please sign in to comment.