diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-07-27 18:07:23 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-07-27 18:07:23 +0200 |
| commit | f1aa17aff5a252f7e7a00b81954e0c172dee9d32 (patch) | |
| tree | 0bec492532f150ee038a40cf2fe1bb19f858c62c | |
| parent | c7fe6516850c08d6082513ebe918f9315a33f818 (diff) | |
sequence_step
| -rw-r--r-- | app/client/live/live.reducer.js | 2 | ||||
| -rw-r--r-- | app/client/modules/pix2pixhd/views/pix2pixhd.live.js | 11 | ||||
| -rw-r--r-- | rpc/img_ops.py | 17 |
3 files changed, 21 insertions, 9 deletions
diff --git a/app/client/live/live.reducer.js b/app/client/live/live.reducer.js index cb9e8a4..810f84c 100644 --- a/app/client/live/live.reducer.js +++ b/app/client/live/live.reducer.js @@ -5,7 +5,7 @@ import types from '../types' const liveInitialState = { loading: false, error: null, - opt: {}, + opt: { hue: 0, saturation: 0, luminosity: 0, sequence_step: 1, recurse_roll: 0, rotate: 0, scale: 0, process_frac: 0.5 }, checkpoints: [], epochs: ['latest'], sequences: [], diff --git a/app/client/modules/pix2pixhd/views/pix2pixhd.live.js b/app/client/modules/pix2pixhd/views/pix2pixhd.live.js index 5443638..aea1ec6 100644 --- a/app/client/modules/pix2pixhd/views/pix2pixhd.live.js +++ b/app/client/modules/pix2pixhd/views/pix2pixhd.live.js @@ -107,7 +107,7 @@ class Pix2PixHDLive extends Component { <div className='params row'> <div className='column'> <ParamGroup - title='Playback' + title='Network' noToggle > <Select live @@ -134,6 +134,11 @@ class Pix2PixHDLive extends Component { options={this.props.epochs} onChange={this.changeEpoch} /> + </ParamGroup> + <ParamGroup + title='Playback' + name='sequence_playing' + > <Slider name='position' min={0.0} max={1.0} type='float' @@ -141,6 +146,10 @@ class Pix2PixHDLive extends Component { onChange={this.seek} /> <Slider live + name='sequence_step' + min={-4.0} max={4.0} type='float' + /> + <Slider live name='frame_delay' min={0.0} max={2.0} type='float' /> diff --git a/rpc/img_ops.py b/rpc/img_ops.py index 3dc52bc..05bbf9f 100644 --- a/rpc/img_ops.py +++ b/rpc/img_ops.py @@ -16,7 +16,7 @@ def process_image(opt, data_opt, im): img = im[:, :, ::-1].copy() processed = False - if data_opt.process_frac == 0: + if data_opt.process_frac == 1.0: return img if data_opt.transform != False: @@ -77,14 +77,17 @@ def mix_next_image(opt, data_opt, rpc_client, im, i, sequence, sequence_i): tmp_path = opt.render_dir + "frame_{:05d}_tmp.png".format(i+1) next_path = opt.render_dir + "frame_{:05d}.png".format(i+1) current_path = opt.render_dir + "ren_{:05d}.png".format(i+1) - meta = { 'i': i, 'sequence_i': sequence_i, 'sequence_len': len(sequence) } + meta = { 'i': i, 'sequence_i': math.floor(sequence_i), 'sequence_len': len(sequence) } if data_opt.sequence and len(sequence): - sequence_path = sequence[sequence_i] - if sequence_i >= len(sequence)-1: + sequence_path = sequence[math.floor(sequence_i)] + if not data_opt.sequence_paused and data_opt.sequence_step != 0: + sequence_i += data_opt.sequence_step + if sequence_i >= len(sequence): print('(((( sequence looped ))))') - sequence_i = 1 - else: - sequence_i += 1 + sequence_i = sequence_i % len(sequence) + else if sequence_i < 0: + print('(((( sequence looped ))))') + sequence_i += len(sequence) if data_opt.store_a is not True: os.remove(last_path) |
