-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated code for sinusoidal, multivariate, UCI and human pose experim…
…ents
- Loading branch information
1 parent
355c496
commit cc67ee9
Showing
61 changed files
with
241,905 additions
and
2 deletions.
There are no files selected for viewing
2,958 changes: 2,958 additions & 0 deletions
2,958
HumanPose/cached/Stacked_HG_ValidationImageNames.txt
Large diffs are not rendered by default.
Oops, something went wrong.
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,62 @@ | ||
import os | ||
import yaml | ||
import shutil | ||
import logging | ||
from pathlib import Path | ||
|
||
|
||
class ParseConfig(object): | ||
""" | ||
Loads and returns the configuration specified in configuration.yml | ||
""" | ||
def __init__(self) -> None: | ||
|
||
# 1. Load the configuration file ------------------------------------------------------------------------------ | ||
try: | ||
f = open('configuration.yml', 'r') | ||
conf_yml = yaml.load(f, Loader=yaml.FullLoader) | ||
f.close() | ||
except FileNotFoundError: | ||
logging.warning('Could not find configuration.yml') | ||
exit() | ||
|
||
|
||
# 2. Initializing ParseConfig object -------------------------------------------------------------------------- | ||
self.trials = conf_yml['trials'] | ||
self.dataset = conf_yml['dataset'] | ||
self.experiment_settings = conf_yml['experiment_settings'] | ||
self.architecture = conf_yml['architecture'] | ||
self.use_hessian = conf_yml['use_hessian'] | ||
self.load_images = conf_yml['load_images'] | ||
|
||
|
||
# 3. Extra initializations based on configuration chosen ------------------------------------------------------ | ||
# Number of convolutional channels for AuxNet | ||
self.architecture['aux_net']['channels'] = [self.architecture['hourglass']['channels']] * 7 | ||
self.architecture['aux_net']['spatial_dim'] = [64, 32, 16, 8, 4, 2, 1] | ||
|
||
# Number of heatmaps (or joints) | ||
self.experiment_settings['num_hm'] = 14 | ||
self.architecture['hourglass']['num_hm'] = 14 | ||
self.architecture['aux_net']['num_hm'] = 14 | ||
|
||
# Number of output nodes for the aux_network | ||
self.architecture['aux_net']['fc'].append(((2 * self.architecture['aux_net']['num_hm']) ** 2) + 2) | ||
|
||
|
||
# 4. Create directory for model save path ---------------------------------------------------------------------- | ||
self.experiment_name = conf_yml['experiment_name'] | ||
i = 1 | ||
model_save_path = os.path.join(conf_yml['save_path'], self.experiment_name + '_' + str(i)) | ||
while os.path.exists(model_save_path): | ||
i += 1 | ||
model_save_path = os.path.join(conf_yml['save_path'], self.experiment_name + '_' + str(i)) | ||
|
||
logging.info('Saving the model at: ' + model_save_path) | ||
|
||
# Copy the configuration file into the model dump path | ||
code_directory = Path(os.path.abspath(__file__)).parent | ||
shutil.copytree(src=str(code_directory), | ||
dst=os.path.join(model_save_path, code_directory.parts[-1])) | ||
|
||
self.save_path = model_save_path |
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,25 @@ | ||
experiment_name: "TIC-TAC" | ||
|
||
trials: 1 | ||
use_hessian: False | ||
|
||
save_path: "/absolute/path/to/directory/" | ||
|
||
dataset: { | ||
mpii_params: {precached: False} | ||
# precached: True implies this exists, False does the post-process and also saves a copy | ||
} | ||
|
||
experiment_settings: { | ||
epochs: 100, # Default: 100 | ||
lr: 0.01, # Default: 1e-2 | ||
batch_size: 32, # Default: 32 | ||
} | ||
|
||
architecture: { | ||
hourglass: {nstack: 2, channels: 64}, | ||
aux_net: {fc: [64, 64, 64]} | ||
} | ||
|
||
# If RAM permits, load all images into memory | ||
load_images: True |
Oops, something went wrong.