diff options
Diffstat (limited to 'app/client/modules/pix2pix/views/pix2pix.live.js')
| -rw-r--r-- | app/client/modules/pix2pix/views/pix2pix.live.js | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/app/client/modules/pix2pix/views/pix2pix.live.js b/app/client/modules/pix2pix/views/pix2pix.live.js index 6f5b1bd..eddcf95 100644 --- a/app/client/modules/pix2pix/views/pix2pix.live.js +++ b/app/client/modules/pix2pix/views/pix2pix.live.js @@ -16,13 +16,12 @@ import * as pix2pixActions from '../pix2pix.actions' class Pix2PixLive extends Component { constructor(props){ super() - if (! props.pix2pix || ! props.pix2pix.data) { props.pix2pixActions.load_directories() } props.actions.get_params() - // props.actions.list_checkpoints() - // props.actions.list_sequences() + props.actions.list_checkpoints('pix2pix') + props.actions.list_sequences('pix2pix') this.changeCheckpoint = this.changeCheckpoint.bind(this) this.changeEpoch = this.changeEpoch.bind(this) this.changeSequence = this.changeSequence.bind(this) @@ -32,7 +31,7 @@ class Pix2PixLive extends Component { } componentWillUpdate(nextProps) { if (nextProps.opt.checkpoint_name && nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) { - this.props.actions.list_epochs(nextProps.opt.checkpoint_name) + this.props.actions.list_epochs('pix2pix', nextProps.opt.checkpoint_name) } } changeCheckpoint(checkpoint_name){ @@ -50,12 +49,20 @@ class Pix2PixLive extends Component { this.props.actions.seek(frame) } start(){ - // pix2pixTasks.live_task() + // console.log(this.props) + console.log('starting up!') + const sequence = this.props.pix2pix.data.sequences[0].name + console.log(sequence) + const checkpoint = this.props.pix2pix.data.checkpoints[0].name + console.log(checkpoint) + console.log(sequence, checkpoint) + this.props.pix2pixTasks.live_task(sequence, checkpoint) } - kill(){ + interrupt(){ // } togglePlaying(){ + console.log('are we..........', this.props.opt.processing) if (this.props.opt.processing) { this.props.actions.pause() } else { @@ -71,7 +78,7 @@ class Pix2PixLive extends Component { } } render(){ - console.log(this.props) + // console.log(this.props) if (this.props.pix2pix.loading) { return <Loading /> } @@ -93,13 +100,13 @@ class Pix2PixLive extends Component { <Select name='sequence_name' title='sequence' - options={this.props.pix2pix.data.sequences} + options={this.props.pix2pix.data.sequences.map(file => file.name)} onChange={this.changeSequence} /> <Select name='checkpoint_name' title='checkpoint' - options={this.props.pix2pix.data.checkpoints} + options={this.props.pix2pix.data.checkpoints.map(file => file.name)} onChange={this.changeCheckpoint} /> <Select @@ -249,7 +256,7 @@ class Pix2PixLive extends Component { return ( <Button title={'GPU Idle'} - onClick={this.start} + onClick={() => this.start()} >Start</Button> ) } @@ -257,8 +264,8 @@ class Pix2PixLive extends Component { return ( <Button title={'GPU Busy'} - onClick={this.kill} - >Kill</Button> + onClick={() => this.interrupt()} + >Interrupt</Button> ) } if (! this.props.opt.processing) { @@ -273,7 +280,7 @@ class Pix2PixLive extends Component { <Button title={'Processing'} onClick={this.togglePlaying} - >Restart</Button> + >Pause</Button> ) } } @@ -293,6 +300,7 @@ const mapStateToProps = state => ({ const mapDispatchToProps = (dispatch, ownProps) => ({ actions: bindActionCreators(liveActions, dispatch), pix2pixActions: bindActionCreators(pix2pixActions, dispatch), + pix2pixTasks: bindActionCreators(pix2pixTasks, dispatch),s }) export default connect(mapStateToProps, mapDispatchToProps)(Pix2PixLive) |
