summaryrefslogtreecommitdiff
path: root/app/client/modules/pix2pixhd/views
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-06-20 16:12:38 +0200
committerJules Laplace <julescarbon@gmail.com>2018-06-20 16:12:38 +0200
commit09b4d1541e6e06563a40f8829048e4225ed8fcf9 (patch)
tree4d4547b855f3f006dd0b7fc28e558b7167af278d /app/client/modules/pix2pixhd/views
parent4ccd160957e84c95c4f311333385f3eda130652c (diff)
mandatory results folder
Diffstat (limited to 'app/client/modules/pix2pixhd/views')
-rw-r--r--app/client/modules/pix2pixhd/views/pix2pixhd.live.js53
-rw-r--r--app/client/modules/pix2pixhd/views/pix2pixhd.results.js22
-rw-r--r--app/client/modules/pix2pixhd/views/pix2pixhd.show.js1
3 files changed, 46 insertions, 30 deletions
diff --git a/app/client/modules/pix2pixhd/views/pix2pixhd.live.js b/app/client/modules/pix2pixhd/views/pix2pixhd.live.js
index 3f027a1..5dd4153 100644
--- a/app/client/modules/pix2pixhd/views/pix2pixhd.live.js
+++ b/app/client/modules/pix2pixhd/views/pix2pixhd.live.js
@@ -4,7 +4,7 @@ import { connect } from 'react-redux'
import {
ParamGroup, Param, Player,
- Slider, Select, Button, Loading
+ Slider, Select, TextInput, Button, Loading
} from '../../../common/'
import { startRecording, stopRecording, saveFrame, toggleFPS } from '../../../live/player'
@@ -52,10 +52,12 @@ class Pix2PixHDLive extends Component {
}
start(){
// console.log(this.props)
- const sequence = this.props.pix2pixhd.data.sequences[0].name
- const checkpoint = this.props.pix2pixhd.data.checkpoints[0].name
+ const sequence = this.props.live.opt.sequence_name
+ const checkpoint = this.props.live.opt.checkpoint_name
console.log('starting up!', sequence, checkpoint)
- this.props.actions.tasks.live_task(sequence, checkpoint)
+ this.props.actions.tasks.live_task(sequence, checkpoint, {
+ folder_id: resultsFolder.id,
+ })
}
interrupt(){
this.props.actions.queue.stop_task('gpu')
@@ -121,21 +123,10 @@ class Pix2PixHDLive extends Component {
/>
<Slider live
name='frame_delay'
- min={0.05} max={2.0} type='float'
+ min={0.0} max={2.0} type='float'
/>
{this.renderRestartButton()}
- <Button
- title={
- this.props.opt.savingVideo
- ? 'Saving video...'
- : this.props.opt.recording
- ? 'Recording (' + timeInSeconds(this.props.opt.recordFrames/25) +')'
- : 'Record video'
- }
- onClick={this.toggleRecording}
- >
- {this.props.opt.savingVideo ? 'Saving' : this.props.opt.recording ? 'Recording' : 'Record'}
- </Button>
+ {this.renderRecordButton()}
<Button
title={'Save frame'}
onClick={saveFrame}
@@ -143,12 +134,20 @@ class Pix2PixHDLive extends Component {
Save
</Button>
<ParamGroup
- title='Render on server'
+ title='Record video'
name='store_b'
onToggle={(value) => {
// now storing frames on server...
}}
>
+ <TextInput
+ title='Video name'
+ name='final_tag'
+ value={this.props.opt.final_tag}
+ onSave={value => {
+ this.props.actions.live.set_param('final_tag', value)
+ }}
+ />
</ParamGroup>
<p class='last_message'>{this.props.last_message}</p>
@@ -264,6 +263,7 @@ class Pix2PixHDLive extends Component {
)
}
renderRestartButton(){
+ console.log(this.props.runner.gpu)
if (this.props.runner.gpu.status === 'IDLE') {
return (
<Button
@@ -307,6 +307,23 @@ class Pix2PixHDLive extends Component {
</div>
)
}
+ renderRecordButton(){
+ return null
+ // return (
+ // <Button
+ // title={
+ // this.props.opt.savingVideo
+ // ? 'Saving video...'
+ // : this.props.opt.recording
+ // ? 'Recording (' + timeInSeconds(this.props.opt.recordFrames/25) +')'
+ // : 'Record video'
+ // }
+ // onClick={this.toggleRecording}
+ // >
+ // {this.props.opt.savingVideo ? 'Saving' : this.props.opt.recording ? 'Recording' : 'Record'}
+ // </Button>
+ // )
+ }
}
function timeInSeconds(n){
return n.toFixed(1) + ' s.'
diff --git a/app/client/modules/pix2pixhd/views/pix2pixhd.results.js b/app/client/modules/pix2pixhd/views/pix2pixhd.results.js
index ac0bb74..af8d90a 100644
--- a/app/client/modules/pix2pixhd/views/pix2pixhd.results.js
+++ b/app/client/modules/pix2pixhd/views/pix2pixhd.results.js
@@ -18,20 +18,21 @@ class Pix2pixHDResults extends Component {
render(){
if (! this.props.pix2pixhd.results) return <Loading progress={this.props.pix2pixhd.progress} />
- const { results, renders, files } = this.props.pix2pixhd.results
-console.log(results)
+ const { resultsFolder, results, renders, files } = this.props.pix2pixhd.results
+ console.log(results)
+
return (
<div className='app pix2pixhd'>
<div className='heading row middle'>
<h1>Pix2PixHD Results</h1>
</div>
<div class='rows params renders'>
-
- <h3>results</h3>
+
<FileList
- files={results}
+ linkFiles
+ files={files}
orderBy='date desc'
- fields={'name date count'}
+ fields={'name date size'}
onClick={(file, e) => {
e.preventDefault()
e.stopPropagation()
@@ -39,7 +40,7 @@ console.log(results)
this.handlePick(file)
}}
/>
-
+
<h3>renders</h3>
<FileList
files={renders}
@@ -53,12 +54,11 @@ console.log(results)
}}
/>
- <h3>files</h3>
+ <h3>results</h3>
<FileList
- linkFiles
- files={files}
+ files={results}
orderBy='date desc'
- fields={'name date size'}
+ fields={'name date count'}
onClick={(file, e) => {
e.preventDefault()
e.stopPropagation()
diff --git a/app/client/modules/pix2pixhd/views/pix2pixhd.show.js b/app/client/modules/pix2pixhd/views/pix2pixhd.show.js
index 5777ac0..d58ee80 100644
--- a/app/client/modules/pix2pixhd/views/pix2pixhd.show.js
+++ b/app/client/modules/pix2pixhd/views/pix2pixhd.show.js
@@ -86,7 +86,6 @@ class Pix2PixHDShow extends Component {
const input = pix2pixhd.data.fileLookup[dataset.input[0]]
if (! input) return null
if (input.name && input.name.match(/(gif|jpe?g|png)$/i)) return null
- console.log(dataset)
return (
<div>
<div class={'actions'}>