diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-17 21:16:57 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-17 21:16:57 +0200 |
| commit | cc36bb1ad49dc054b32f20a97386a938a529fe0e (patch) | |
| tree | f3f486f8376f7dc52e785f39127d443b6d6d8499 /app/client/modules/pix2pixhd/pix2pixhd.tasks.js | |
| parent | 8048cfc3981f79f2b65b23c124581aa51ef3768b (diff) | |
pix2pixhd modules
Diffstat (limited to 'app/client/modules/pix2pixhd/pix2pixhd.tasks.js')
| -rw-r--r-- | app/client/modules/pix2pixhd/pix2pixhd.tasks.js | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/app/client/modules/pix2pixhd/pix2pixhd.tasks.js b/app/client/modules/pix2pixhd/pix2pixhd.tasks.js new file mode 100644 index 0000000..2e7cbbd --- /dev/null +++ b/app/client/modules/pix2pixhd/pix2pixhd.tasks.js @@ -0,0 +1,54 @@ +import uuidv1 from 'uuid/v1' + +import socket from '../../socket' +import types from '../../types' + +import actions from '../../actions' + +import module from './pix2pixhd.module' + +export const fetch_task = (url, file_id, dataset) => dispatch => { + if (! url) return console.log('input file inaccessible (no url)') + const task = { + module: module.name, + activity: 'fetch', + dataset: dataset, + opt: { + url, + file_id, + dataset, + } + } + return actions.queue.add_task(task) +} + +export const train_task = (dataset, folder_id, epochs=1) => dispatch => { + const task = { + module: module.name, + activity: 'train', + dataset: dataset.name, + epoch: 0, + epochs: epochs, + opt: { + folder_id: folder_id, + load_size: 264, // switch to 256 for pix2wav + } + } + console.log(task) + return actions.queue.add_task(task) +} + +export const live_task = (sequence, checkpoint) => dispatch => { + const task = { + module: module.name, + activity: 'live', + dataset: sequence, + checkpoint, + opt: { + poll_delay: 0.09, + } + } + console.log(task) + console.log('add live task') + return actions.queue.add_task(task) +} |
