summaryrefslogtreecommitdiff
path: root/app/relay/modules
diff options
context:
space:
mode:
Diffstat (limited to 'app/relay/modules')
-rw-r--r--app/relay/modules/index.js13
-rw-r--r--app/relay/modules/pix2pix.js71
-rw-r--r--app/relay/modules/pix2pixhd.js5
-rw-r--r--app/relay/modules/samplernn.js61
-rw-r--r--app/relay/modules/test.js36
5 files changed, 186 insertions, 0 deletions
diff --git a/app/relay/modules/index.js b/app/relay/modules/index.js
new file mode 100644
index 0000000..65ec75c
--- /dev/null
+++ b/app/relay/modules/index.js
@@ -0,0 +1,13 @@
+import pix2pix from './pix2pix'
+// import pix2pixhd from './pix2pixhd'
+import samplernn from './samplernn'
+import test from './test'
+// torch-warp?
+// audio style transfer?
+// cyclegan?
+export default {
+ pix2pix,
+ // pix2pixhd,
+ samplernn,
+ test,
+} \ No newline at end of file
diff --git a/app/relay/modules/pix2pix.js b/app/relay/modules/pix2pix.js
new file mode 100644
index 0000000..3727964
--- /dev/null
+++ b/app/relay/modules/pix2pix.js
@@ -0,0 +1,71 @@
+import path from 'path'
+
+const name = 'pix2pix'
+const cwd = process.env.PIX2PIX_CWD || path.join(process.env.HOME, 'code/' + name + '/')
+
+const dataset = {
+ type: 'pytorch',
+ script: 'datasets/combine_A_and_B.py',
+ params: (task) => {
+ }
+// python datasets/combine_A_and_B.py \
+// --fold_A /home/lens/Desktop/thumbs/woodscaled_4/A \
+// --fold_B /home/lens/Desktop/thumbs/woodscaled_4/B \
+// --fold_AB datasets/woodscaled_4/
+}
+const train = {
+ type: 'pytorch',
+ script: 'train.py',
+ params: (task) => {
+ },
+// python train.py \
+// --dataroot "./datasets/$dataset" \
+// --name "$dataset" \
+// --model pix2pix \
+// --loadSize 264 \
+// --fineSize 256 \
+// --which_model_netG unet_256 \
+// --which_direction AtoB \
+// --lambda_B 100 \
+// --dataset_mode aligned \
+// --epoch_count $epochs \
+// --which_epoch latest \
+// --continue_train \
+// --no_lsgan --norm batch --pool_size 0
+}
+const generate = {
+ type: 'pytorch',
+ script: 'generate.py',
+ params: (task) => {
+ },
+}
+const live = {
+ type: 'pytorch',
+ script: 'live-mogrify.py',
+ params: (task) => {
+ },
+ // python live-mogrify.py \
+ // --dataroot "./sequences/$sequence" \
+ // --start_img "./sequences/$sequence/frame_00001.png" \
+ // --experiment "$checkpoint" \
+ // --name "$checkpoint" \
+ // --recursive --recursive-frac 0.1 \
+ // --sequence --sequence-frac 0.3 \
+ // --process-frac 0.5 \
+ // --transition \
+ // --transition-min 0.05 \
+ // --how_many 100000 --transition-period 1000 \
+ // --loadSize 256 --fineSize 256 \
+ // --just-copy --poll_delay 0.09 \
+ // --model test --which_model_netG unet_256 \
+ // --which_direction AtoB --dataset_mode recursive \
+ // --which_epoch latest \
+ // --norm batch
+}
+
+export default {
+ name, cwd,
+ activities: {
+ dataset, train, generate, live,
+ }
+}
diff --git a/app/relay/modules/pix2pixhd.js b/app/relay/modules/pix2pixhd.js
new file mode 100644
index 0000000..9aa30d0
--- /dev/null
+++ b/app/relay/modules/pix2pixhd.js
@@ -0,0 +1,5 @@
+import path from 'path'
+
+export default {
+ enabled: false,
+} \ No newline at end of file
diff --git a/app/relay/modules/samplernn.js b/app/relay/modules/samplernn.js
new file mode 100644
index 0000000..4181a32
--- /dev/null
+++ b/app/relay/modules/samplernn.js
@@ -0,0 +1,61 @@
+import path from 'path'
+
+const name = 'samplernn'
+const cwd = process.env.TEST_CWD || path.join(process.env.HOME, 'code/' + name + '/')
+
+const fetch = {
+ type: 'perl',
+ script: 'get.pl',
+ params: (task) => {
+ }
+ // perl get.pl url
+}
+const dataset = {
+ type: 'perl',
+ script: 'dataset.pl',
+ params: (task) => {
+ }
+ // perl dataset.pl filename.flac
+}
+const train = {
+ type: 'pytorch',
+ script: 'train.py',
+ params: (task) => {
+ },
+ onComplete: publish,
+ // python train.py \
+ // --exp $checkpoint_name --dataset $dataset_name \
+ // --frame_sizes 8 2 --n_rnn 2 \
+ // --sample_length $sample_length \
+ // --n_samples $n_samples \
+ // --keep_old_checkpoints False \
+ // --epoch_limit $epoch_limit \
+}
+const generate = {
+ type: 'pytorch',
+ script: 'generate.py',
+ params: (task) => {
+ },
+ onComplete: publish,
+ // python generate.py \
+ // --exp $checkpoint_name --dataset $dataset_name \
+ // --frame_sizes 8 2 --n_rnn 2 \
+ // --sample_length $sample_length \
+ // --n_samples $n_samples \
+ // --keep_old_checkpoints False \
+ // --epoch_limit $epoch_limit \
+}
+const publish = {
+ type: 'perl',
+ script: 'latest.pl',
+ params: (task) => {
+ }
+}
+// after train and generate, run perl latest.pl -l $checkpoint_name
+
+export default {
+ name, cwd,
+ activities: {
+ dataset, train, generate,
+ }
+}
diff --git a/app/relay/modules/test.js b/app/relay/modules/test.js
new file mode 100644
index 0000000..bfac514
--- /dev/null
+++ b/app/relay/modules/test.js
@@ -0,0 +1,36 @@
+import path from 'path'
+
+const name = 'test'
+const cwd = process.env.TEST_CWD || './test/module/'
+
+const dataset = {
+ type: 'perl',
+ script: 'test.pl',
+ params: (task) => {
+ }
+}
+const train = {
+ type: 'perl',
+ script: 'test.pl',
+ params: (task) => {
+ }
+}
+const generate = {
+ type: 'perl',
+ script: 'test.pl',
+}
+const render = {
+ type: 'perl',
+ script: 'test.pl',
+}
+const live = {
+ type: 'pytorch',
+ script: 'test.py',
+}
+
+export default {
+ name, cwd,
+ activities: {
+ dataset, train, generate, render, live,
+ }
+}