From 7910767b7283e62f03dec5f86e08a796c792080f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 4 Sep 2018 14:45:35 +0200 Subject: list checkpoint and epoch --- .../modules/pix2pixhd/views/pix2pixhd.train.js | 56 +++++++++++++++------- 1 file changed, 40 insertions(+), 16 deletions(-) (limited to 'app/client/modules/pix2pixhd/views') diff --git a/app/client/modules/pix2pixhd/views/pix2pixhd.train.js b/app/client/modules/pix2pixhd/views/pix2pixhd.train.js index 8901ee8..cd6507f 100644 --- a/app/client/modules/pix2pixhd/views/pix2pixhd.train.js +++ b/app/client/modules/pix2pixhd/views/pix2pixhd.train.js @@ -10,7 +10,7 @@ import { Loading, FileList, FileRow, Select, SelectGroup, Group, Button, - TextInput, + TextInput, NumberInput, CurrentTask, TaskList } from '../../../common' import DatasetForm from '../../../dataset/dataset.form' @@ -26,7 +26,7 @@ class Pix2PixHDTrain extends Component { super(props) this.handleChange = this.handleChange.bind(this) this.state = { - sequence: '', + checkpoint_name: '', epoch: 'latest', augment_take: 100, augment_make: 20, @@ -46,11 +46,22 @@ class Pix2PixHDTrain extends Component { this.props.history.push('/pix2pixhd/new/') } } - handleChange(value, name){ - this.setState({ [name]: value }) + componentDidUpdate(prevProps, prevState){ + if (! prevProps.pix2pixhd.data && this.props.pix2pixhd.data) { + console.log('set checkpoint_name') + this.setState({ + checkpoint_name: this.props.pix2pixhd.data.sequences[0].name, + epoch: 'latest' + }) + } + else if (prevState.checkpoint_name !== this.state.checkpoint_name) { + this.setState({ epoch: 'latest' }) + this.props.actions.list_epochs(this.state.checkpoint_name) + } } - changeCheckpoint(name){ - // this.props.actions.list_epochs('pix2pixhd', nextProps.opt.checkpoint_name) + handleChange(name, value){ + console.log('name', name, 'value', value) + this.setState({ [name]: value }) } render(){ if (this.props.pix2pixhd.loading) { @@ -59,7 +70,7 @@ class Pix2PixHDTrain extends Component { const { pix2pixhd, match, history, queue } = this.props const { folderLookup, datasetLookup } = (pix2pixhd.data || {}) const folder = (folderLookup || {})[pix2pixhd.folder_id] || {} - console.log(pix2pixhd) + // console.log(pix2pixhd) const checkpointGroups = Object.keys(folderLookup).map(id => { const folder = this.props.pix2pixhd.data.folderLookup[id] @@ -77,35 +88,48 @@ class Pix2PixHDTrain extends Component { } }).filter(n => !!n && !!n.options.length).sort((a,b) => a.name.localeCompare(b.name)) + console.log('state', this.props.pix2pixhd.data.epochs) + // console.log(this.state.checkpoint_name, this.state.epoch) + return (
-

pix2pixhd training

- pix2pixhd training +
+
+