forked from ashleve/lightning-hydra-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from PTG-Kitware/dev/feat_v6
Refactor data generation
- Loading branch information
Showing
16 changed files
with
957 additions
and
715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generate training data | ||
|
||
```bash | ||
$ python tcn_hpl/data/utils/ptg_datagenerator.py --config configs/experiment/r18/r18.yaml | ||
``` | ||
|
||
* Update `paths.data_dir` in the config to point to the folder generated by this script | ||
|
||
# Train | ||
```bash | ||
$ python tcn_hpl/train.py experiment=r18/feat_v6 | ||
``` | ||
|
||
## To view training metrics | ||
Navigate to the ${paths.root_dir} directory set in your experiment config. Then run | ||
```bash | ||
$ aim up - p {port_num} | ||
``` | ||
|
||
then go to ``http://127.0.0.1:{port_num}`` in your browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ActivationDelta: | ||
_target_: tcn_hpl.data.components.augmentations.ActivationDelta | ||
conf_delta: 0.05 | ||
num_obj_classes: 42 | ||
feat_version: 2 | ||
top_k_objects: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ NormalizePixelPts: | |
im_h: 720 | ||
num_obj_classes: 42 | ||
feat_version: 2 | ||
top_k_objects: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
# @package _global_ | ||
|
||
# to execute this experiment run: | ||
# python train.py experiment=example | ||
topic: "medical" | ||
task: "r18" | ||
feature_version: 5 | ||
|
||
defaults: | ||
- override /data: ptg | ||
- override /model: ptg | ||
- override /callbacks: default | ||
- override /trainer: gpu | ||
- override /paths: default | ||
- override /logger: aim | ||
|
||
# all parameters below will be merged with parameters from default configurations set above | ||
|
||
tags: ["r18", "ms_tcn"] | ||
|
||
seed: 12345 | ||
|
||
trainer: | ||
min_epochs: 50 | ||
max_epochs: 500 | ||
|
||
|
||
model: | ||
compile: false | ||
|
||
net: | ||
dim: 33 # length of feature vector when top_k_objects=1 | ||
#dim: xx # length of feature vector when top_k_objects=2 | ||
|
||
|
||
# GENERATE TRAINING DATA | ||
data_gen: | ||
top_k_objects: 1 | ||
|
||
data_type: "pro" | ||
dataset_kwcoco: "/data/PTG/medical/training/yolo_object_detector/detect/r18_all/r18_all_all_obj_results_with_dets_and_pose.mscoco.json" | ||
train_vid_ids: [1, 2, 4, 5, 6, 8, 9, 11, 12, 14, 15, 16, 17, 19, 20, 21, | ||
22, 23, 24, 26, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, | ||
42, 43, 44, 45, 46, 48, 49, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, | ||
61, 62, 63, 64, 65, 66, 67, 68, 69, 70] | ||
val_vid_ids: [3, 7, 10, 18, 27, 32, 41] | ||
test_vid_ids: [50, 13, 47, 25] | ||
names_black_gloves: [] | ||
names_blue_gloves: [] | ||
#data_type: "lab" | ||
#dataset_kwcoco: "/data/PTG/medical/training/yolo_object_detector/detect/r18_all_bbn_lab_data/r18_all_bbn_lab_data_all_obj_results.mscoco.json" | ||
#train_vid_ids: [1, 2, 3, 4, 5, 6, 7, 8] | ||
#val_vid_ids: [9] | ||
#test_vid_ids: [10] | ||
#names_black_gloves: [] | ||
#names_blue_gloves: [] | ||
|
||
filter_black_gloves: false | ||
filter_blue_gloves: false | ||
|
||
activity_config_fn: "/home/local/KHQ/hannah.defazio/angel_system/config/activity_labels/medical/r18.yaml" | ||
|
||
# This matches the folder name created in the data generator | ||
exp_name: "${task}_${data_gen.data_type}_data_top_${data_gen.top_k_objects}_objs_feat_v${feature_version}" | ||
|
||
# TRAINING | ||
exp_name: ${data_gen.exp_name}_win_25 | ||
|
||
paths: | ||
data_dir: "/data/PTG/medical/training/activity_classifier/TCN_data/${task}/${data_gen.exp_name}" | ||
root_dir: "/data/PTG/medical/training/activity_classifier/TCN_HPL/" | ||
|
||
data: | ||
num_classes: 6 # activities: includes background | ||
batch_size: 512 | ||
num_workers: 0 | ||
epoch_length: 20000 | ||
window_size: 45 | ||
sample_rate: 1 | ||
|
||
# AUGMENTATIONS | ||
all_transforms: | ||
train_order: [] #["MoveCenterPts", "NormalizePixelPts"] | ||
test_order: [] #["NormalizePixelPts"] | ||
MoveCenterPts: | ||
feat_version: ${feature_version} | ||
num_obj_classes: 6 # not including background | ||
NormalizeFromCenter: | ||
feat_version: ${feature_version} | ||
NormalizePixelPts: | ||
feat_version: ${feature_version} | ||
num_obj_classes: 6 # not including background | ||
|
||
|
||
logger: | ||
aim: | ||
experiment: ${exp_name} | ||
capture_terminal_logs: true | ||
|
||
task_name: ${exp_name} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.