diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-09-23 20:37:43 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-09-23 20:37:43 +0200 |
| commit | d0b5aee1fbd50d58c418952cd649c6ed28260e23 (patch) | |
| tree | 84c242c1f136b2b77a7005faecfb41fe5103f594 /app/client | |
| parent | 37e84dd361c446245db47b7ecd344dc668d4f4f7 (diff) | |
more tasklist stuff
Diffstat (limited to 'app/client')
| -rw-r--r-- | app/client/common/currentTask.component.js | 2 | ||||
| -rw-r--r-- | app/client/common/fileList.component.js | 2 | ||||
| -rw-r--r-- | app/client/common/taskList.component.js | 2 | ||||
| -rw-r--r-- | app/client/dataset/dataset.reducer.js | 5 | ||||
| -rw-r--r-- | app/client/modules/pix2pixhd/pix2pixhd.actions.js | 10 | ||||
| -rw-r--r-- | app/client/modules/pix2pixhd/pix2pixhd.tasks.js | 20 | ||||
| -rw-r--r-- | app/client/modules/pix2pixhd/views/pix2pixhd.train.js | 13 | ||||
| -rw-r--r-- | app/client/modules/pix2pixhd/views/sequence.editor.js | 27 |
8 files changed, 45 insertions, 36 deletions
diff --git a/app/client/common/currentTask.component.js b/app/client/common/currentTask.component.js index ef976bc..c053a13 100644 --- a/app/client/common/currentTask.component.js +++ b/app/client/common/currentTask.component.js @@ -31,7 +31,7 @@ function CurrentTask ({ cpu, gpu, processor }) { ? <span>(currently #{epoch})</span> : ""} <br/><br/> - <div className='quiet'>{last_message}</div> + <div className='quiet lastMessage'>{last_message}</div> </div> ) } diff --git a/app/client/common/fileList.component.js b/app/client/common/fileList.component.js index 8f79148..12f6865 100644 --- a/app/client/common/fileList.component.js +++ b/app/client/common/fileList.component.js @@ -119,7 +119,7 @@ export const FileRow = props => { <div className={"epoch " + util.hush_null(epoch)[0]}>{epoch > 0 ? 'ep. ' + epoch : ''}</div> } {fields.has('date') && - <div className={"date " + util.carbon_date(date)}>{moment(date).format("YYYY-MM-DD")}</div> + <div className={"date " + util.carbon_date(date)} title={moment(date).format("YYYY-MM-DD HH:mm")}>{moment(date).format("YYYY-MM-DD")}</div> } {fields.has('datetime') && <div className={"datetime"}> diff --git a/app/client/common/taskList.component.js b/app/client/common/taskList.component.js index 272ff80..a2f1df0 100644 --- a/app/client/common/taskList.component.js +++ b/app/client/common/taskList.component.js @@ -59,7 +59,7 @@ class TaskList extends Component { <div className='row'> <div className='activity'>{task.activity} {task.module}</div> <div className='dataset'>{dataset_link}</div> - <div className={"age " + util.carbon_date(task.updated_at)}>{util.get_age(task.updated_at)}</div> + <div className={"age " + util.carbon_date(task.updated_at)} title={task.updated_at}>{util.get_age(task.updated_at)}</div> <div className='options'> <span className='destroy' onClick={() => this.handleDestroy(task)}>x</span> </div> diff --git a/app/client/dataset/dataset.reducer.js b/app/client/dataset/dataset.reducer.js index f303a7f..9b1c322 100644 --- a/app/client/dataset/dataset.reducer.js +++ b/app/client/dataset/dataset.reducer.js @@ -61,10 +61,7 @@ const datasetReducer = (state = datasetInitialState(), action) => { case types.dataset.list_epochs: return { ...state, - data: { - ...state.data, - epochs: action.data.epochs, - } + epochs: action.data.epochs, } default: diff --git a/app/client/modules/pix2pixhd/pix2pixhd.actions.js b/app/client/modules/pix2pixhd/pix2pixhd.actions.js index 2c72f06..44a42c4 100644 --- a/app/client/modules/pix2pixhd/pix2pixhd.actions.js +++ b/app/client/modules/pix2pixhd/pix2pixhd.actions.js @@ -209,11 +209,11 @@ export const count_dataset = (checkpoint_name) => (dispatch) => { actions.socket.count_directory({ module, dir: 'datasets/' + checkpoint_name + '/train_A/' }), ], (percent, i, n) => { console.log('pix2pixhd load progress', i, n) - dispatch({ - type: types.app.load_progress, - progress: { i, n }, - data: { module: 'pix2pixhd' }, - }) + // dispatch({ + // type: types.app.load_progress, + // progress: { i, n }, + // data: { module: 'pix2pixhd' }, + // }) }).then(res => { const [sequence, datasetCount] = res //, datasets, results, output, datasetUsage, lossReport] = res const sequenceCount = sequence.length diff --git a/app/client/modules/pix2pixhd/pix2pixhd.tasks.js b/app/client/modules/pix2pixhd/pix2pixhd.tasks.js index 8fec652..89184d2 100644 --- a/app/client/modules/pix2pixhd/pix2pixhd.tasks.js +++ b/app/client/modules/pix2pixhd/pix2pixhd.tasks.js @@ -23,10 +23,12 @@ export const fetch_task = (url, file_id, dataset) => dispatch => { } export const train_task = (dataset, folder_id, epochs=1) => dispatch => { + dataset = dataset.name || dataset + if (dataset === 'PLACEHOLDER') return const task = { module: module.name, activity: 'train', - dataset: dataset.name || dataset, + dataset, epoch: 0, epochs: epochs, opt: { @@ -58,6 +60,7 @@ export const live_task = (sequence, checkpoint, opt) => dispatch => { } export const augment_task = (dataset, opt) => dispatch => { + if (dataset === 'PLACEHOLDER') return const task = { module: module.name, activity: 'augment', @@ -72,14 +75,17 @@ export const augment_task = (dataset, opt) => dispatch => { return actions.queue.add_task(task) } -export const clear_recursive_task = (dataset) => dispatch => { +export const create_dataset_task = (opt) => dispatch => { const task = { module: module.name, - activity: 'clear_recursive', - dataset, + activity: 'create_dataset', + dataset: opt.title, + folder_id: opt.folder_id, + opt: { + ...opt, + } } console.log(task) - console.log('add clear recursive task') + console.log('add create_dataset task') return actions.queue.add_task(task) -} - +}
\ No newline at end of file diff --git a/app/client/modules/pix2pixhd/views/pix2pixhd.train.js b/app/client/modules/pix2pixhd/views/pix2pixhd.train.js index 1641976..c5e8e67 100644 --- a/app/client/modules/pix2pixhd/views/pix2pixhd.train.js +++ b/app/client/modules/pix2pixhd/views/pix2pixhd.train.js @@ -83,7 +83,7 @@ class Pix2PixHDTrain extends Component { if (folder.name === 'results') return const datasets = folder.datasets.map(name => { const dataset = datasetLookup[name] - if (dataset.checkpoints.length) { + if (dataset.isBuilt && dataset.checkpoints.length) { return name } return null @@ -104,10 +104,10 @@ class Pix2PixHDTrain extends Component { </div> <div className='columns'> <div className='column'> - <Group title='Dataset'> + <Group title='Sequence'> <SelectGroup name='checkpoint_name' - title='Dataset' + title='Sequence name' options={checkpointGroups} onChange={this.handleChange} placeholder='Pick a dataset' @@ -116,7 +116,7 @@ class Pix2PixHDTrain extends Component { <Select title="Epoch" name="epoch" - options={this.props.pix2pixhd.data.epochs} + options={this.props.pix2pixhd.epochs} onChange={this.handleChange} value={this.state.epoch} /> @@ -132,11 +132,12 @@ class Pix2PixHDTrain extends Component { renderEditor(){ const { pix2pixhd, queue } = this.props - const { checkpoint } = pix2pixhd + const { checkpoint, folder_id } = pix2pixhd return ( <div> <Group title='Sequence Editor'> <SequenceEditor + folder_id={folder_id} module={pix2pixhdModule} checkpoint={checkpoint} /> @@ -156,7 +157,7 @@ class Pix2PixHDTrain extends Component { }) }} onTrain={() => { - this.props.remote.train_task(this.state.checkpoint_name, pix2pixhd.folder_id, 1) + this.props.remote.train_task(this.state.checkpoint_name, folder_id, 1) setTimeout(() => { // auto-generate epoch demo this.props.remote.augment_task(this.state.checkpoint_name, { ...this.state, diff --git a/app/client/modules/pix2pixhd/views/sequence.editor.js b/app/client/modules/pix2pixhd/views/sequence.editor.js index 06f3889..33ed629 100644 --- a/app/client/modules/pix2pixhd/views/sequence.editor.js +++ b/app/client/modules/pix2pixhd/views/sequence.editor.js @@ -2,11 +2,13 @@ import { h, Component } from 'preact' import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import { Route, Link } from 'react-router-dom' +import moment from 'moment/min/moment.min' import util from '../../../util' import { FileViewer, Timeline, Param, Button, Group, TextInput } from '../../../common' +import * as pix2pixhdTasks from '../pix2pixhd.tasks' import actions from '../../../actions' const initialState = { @@ -65,7 +67,7 @@ class SequenceEditor extends Component { console.log(checkpoint) this.setState({ ...initialState, - title: checkpoint.name + '_v_' + Date.now() + title: checkpoint.name + '_' + moment().format("YYYYMMDD") }) } @@ -78,28 +80,31 @@ class SequenceEditor extends Component { } render() { - const { app, checkpoint } = this.props + const { app, remote, checkpoint, folder_id } = this.props const { cursor, selection, title } = this.state const path = "sequences/" + checkpoint.name return ( <div className='sequenceEditor row'> {selection ? <div className='form'> + <Param title='Selection length'> + {selection.end.i - selection.start.i}{' frames'} + </Param> + <Param title='Duration'> + {util.frameTimestamp(selection.end.i - selection.start.i)} + </Param> <Group title='New dataset'> - <Param title='Selection length'> - {selection.end.i - selection.start.i}{' frames'} - </Param> - <Param title='Duration'> - {util.frameTimestamp(selection.end.i - selection.start.i)} - </Param> <TextInput title='Title dataset' value={title} - onInput={title => this.setState({ title })} + onInput={title => this.setState({ title: title.replace(/ /g, '_').replace(/\/\./g, '') })} /> <Button title='Create a new dataset?' - >Create</Button> + onClick={() => remote.create_dataset_task({ title, sequence: checkpoint.name, selection, folder_id })} + > + Create + </Button> </Group> </div> : <div className='form'><Group title='New dataset'>Please select some frames</Group></div> @@ -143,7 +148,7 @@ const mapStateToProps = state => ({ }) const mapDispatchToProps = (dispatch, ownProps) => ({ - actions: bindActionCreators({}, dispatch), + remote: bindActionCreators(pix2pixhdTasks, dispatch), }) export default connect(mapStateToProps, mapDispatchToProps)(SequenceEditor) |
