summaryrefslogtreecommitdiff
path: root/app/client
diff options
context:
space:
mode:
Diffstat (limited to 'app/client')
-rw-r--r--app/client/live/live.reducer.js14
-rw-r--r--app/client/modules/pix2pix/pix2pix.actions.js6
-rw-r--r--app/client/modules/pix2pix/views/pix2pix.live.js5
-rw-r--r--app/client/socket/socket.task.js4
-rw-r--r--app/client/system/system.reducer.js2
5 files changed, 24 insertions, 7 deletions
diff --git a/app/client/live/live.reducer.js b/app/client/live/live.reducer.js
index 83beb03..d2b4788 100644
--- a/app/client/live/live.reducer.js
+++ b/app/client/live/live.reducer.js
@@ -11,12 +11,13 @@ const liveInitialState = {
sequences: [],
fps: 0,
playing: false,
+ last_message: '',
frame: { i: 0, sequence_i: 0, sequence_len: '1' }
}
const liveReducer = (state = liveInitialState, action) => {
let results;
-
+console.log(action.type)
switch(action.type) {
case types.socket.load_params:
if (! action.opt || ! Object.keys(action.opt).length) {
@@ -65,6 +66,17 @@ const liveReducer = (state = liveInitialState, action) => {
fps: action.fps,
}
+ case types.system.stdout:
+ console.log(action)
+ if (action.data.processor === 'gpu') {
+ console.log('boo>', action.data)
+ return {
+ ...state,
+ last_message: action.data.data,
+ }
+ }
+ return state
+
case types.player.current_frame:
return action.meta ? {
...state,
diff --git a/app/client/modules/pix2pix/pix2pix.actions.js b/app/client/modules/pix2pix/pix2pix.actions.js
index 69572ea..7f5d120 100644
--- a/app/client/modules/pix2pix/pix2pix.actions.js
+++ b/app/client/modules/pix2pix/pix2pix.actions.js
@@ -36,7 +36,8 @@ export const load_directories = (id) => (dispatch) => {
// console.log(datasetUsage)
// const flatDatasets = datasets.filter(s => !s.dir)
- sequences.filter(s => s.dir).forEach(dir => {
+ const sequenceDirectories = sequences.filter(s => s.dir)
+ sequenceDirectories.forEach(dir => {
const dataset = datasetLoader.getDataset(module, datasetLookup, dir.name)
dataset.isBuilt = true
})
@@ -47,6 +48,7 @@ export const load_directories = (id) => (dispatch) => {
})
checkpoints.filter(s => s.dir).forEach(dir => {
+ console.log(dir)
const dataset = datasetLoader.getDataset(module, datasetLookup, dir.name)
dataset.hasCheckpoints = true
})
@@ -113,7 +115,7 @@ export const load_directories = (id) => (dispatch) => {
fileLookup,
datasetLookup,
folders, files,
- sequences,
+ sequences: sequenceDirectories,
datasets,
checkpoints,
// checkpoints,
diff --git a/app/client/modules/pix2pix/views/pix2pix.live.js b/app/client/modules/pix2pix/views/pix2pix.live.js
index ae68307..31c2bde 100644
--- a/app/client/modules/pix2pix/views/pix2pix.live.js
+++ b/app/client/modules/pix2pix/views/pix2pix.live.js
@@ -3,7 +3,7 @@ import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import {
- ParamGroup, Player,
+ ParamGroup, Param, Player,
Slider, Select, Button, Loading
} from '../../../common/'
@@ -137,6 +137,8 @@ class Pix2PixLive extends Component {
>
Save
</Button>
+
+ <p class='last_message'>{this.props.last_message}</p>
</ParamGroup>
</div>
<div className='column'>
@@ -297,6 +299,7 @@ function timeInSeconds(n){
return (n / 10).toFixed(1) + ' s.'
}
const mapStateToProps = state => ({
+ last_message: state.live.last_message,
opt: state.live.opt,
frame: state.live.frame,
checkpoints: state.live.checkpoints,
diff --git a/app/client/socket/socket.task.js b/app/client/socket/socket.task.js
index b33f81a..9e54522 100644
--- a/app/client/socket/socket.task.js
+++ b/app/client/socket/socket.task.js
@@ -26,10 +26,10 @@ socket.on('task_res', (data) => {
case 'kill':
break
case 'stdout':
- return dispatch({ type: types.system.stdout, data: data.data })
+ return dispatch({ type: types.system.stdout, data })
break
case 'stderr':
- return dispatch({ type: types.system.stderr, data: data.data })
+ return dispatch({ type: types.system.stderr, data })
break
case 'add':
break
diff --git a/app/client/system/system.reducer.js b/app/client/system/system.reducer.js
index b1a12c0..0deb3cb 100644
--- a/app/client/system/system.reducer.js
+++ b/app/client/system/system.reducer.js
@@ -218,7 +218,7 @@ const systemReducer = (state = systemInitialState, action) => {
case types.system.stdout:
return {
...state,
- stdout: state.stdout + action.data,
+ stdout: state.stdout + action.data.data,
}
case types.system.stderr:
return {