Skip to content

Commit

Permalink
Merge pull request #122 from ttngu207/main_external-storage
Browse files Browse the repository at this point in the history
feat(model): add labeled_video_file attribute of type `filepath@dlc-processed`
  • Loading branch information
kushalbakshi authored Aug 16, 2024
2 parents 117694e + a085b0c commit d803249
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions element_deeplabcut/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ class File(dj.Part):
-> VideoRecording.File
---
labeled_video_path: varchar(255) # relative path to labeled video
labeled_video_file=null: filepath@dlc-processed
"""

@property
Expand Down Expand Up @@ -964,6 +965,7 @@ def make(self, key):
"labeled_video_path": labeled_video_path.relative_to(
get_dlc_processed_data_dir()
).as_posix(),
"labeled_video_file": labeled_video_path.as_posix(),
}
)

Expand Down
15 changes: 12 additions & 3 deletions tests/tutorial_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
from element_lab.lab import Source, Lab, Protocol, User, Project


if "custom" not in dj.config:
dj.config["custom"] = {}
os.environ["DJ_SUPPORT_FILEPATH_MANAGEMENT"] = "TRUE"
dj.config["filepath_checksum_size_limit"] = 10 * 1024 * 1024 # 10 MB

for key in ("custom", "stores"):
if key not in dj.config:
dj.config[key] = {}

# overwrite dj.config['custom'] values with environment variables if available

Expand Down Expand Up @@ -95,7 +99,12 @@ class Device(dj.Lookup):


# Activate DeepLabCut schema -----------------------------------

# Configure external storage -------------
dj.config["stores"]["dlc-processed"] = dict(
protocol="file",
location=get_dlc_processed_data_dir(),
stage=get_dlc_processed_data_dir(),
)

train.activate(db_prefix + "train", linking_module=__name__)
model.activate(db_prefix + "model", linking_module=__name__)

0 comments on commit d803249

Please sign in to comment.