summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/client/common/fileList.component.js4
-rw-r--r--app/client/modules/pix2pixhd/pix2pixhd.actions.js3
-rw-r--r--app/client/modules/pix2pixhd/pix2pixhd.reducer.js6
-rw-r--r--app/client/modules/pix2pixhd/views/pix2pixhd.results.js68
-rw-r--r--app/relay/runner.js4
5 files changed, 60 insertions, 25 deletions
diff --git a/app/client/common/fileList.component.js b/app/client/common/fileList.component.js
index 1108dbf..688e325 100644
--- a/app/client/common/fileList.component.js
+++ b/app/client/common/fileList.component.js
@@ -64,6 +64,7 @@ export const FileRow = props => {
const size = util.hush_size(file.size)
const date = file.date || file.created_at
const epoch = file.epoch || file.epochs || 0
+ const count = file.count || 0
let name;
let key;
@@ -111,6 +112,9 @@ export const FileRow = props => {
{fields.has('size') &&
<div className={"size " + size[0]}>{size[1]}</div>
}
+ {fields.has('count') &&
+ <div className={"count " + util.hush_null(count)[0]}>{count > 0 ? 'f. ' + count : ''}</div>
+ }
{(fields.has('activity') || fields.has('module')) &&
<div className='activity'>
{fields.has('activity') && file.activity}
diff --git a/app/client/modules/pix2pixhd/pix2pixhd.actions.js b/app/client/modules/pix2pixhd/pix2pixhd.actions.js
index 1b22616..caf6b45 100644
--- a/app/client/modules/pix2pixhd/pix2pixhd.actions.js
+++ b/app/client/modules/pix2pixhd/pix2pixhd.actions.js
@@ -140,7 +140,7 @@ export const load_results = (id) => (dispatch) => {
console.log('hi')
const module = pix2pixhdModule.name
util.allProgress([
- actions.file.index({ module, generated: true }),
+ actions.file.index({ module, generated: 1 }),
actions.socket.list_sequences({ module, dir: 'results' }),
actions.socket.list_directory({ module, dir: 'renders' }),
], (percent, i, n) => {
@@ -152,6 +152,7 @@ export const load_results = (id) => (dispatch) => {
dispatch({
type: types.pix2pixhd.load_results,
results: {
+ files,
results,
renders,
}
diff --git a/app/client/modules/pix2pixhd/pix2pixhd.reducer.js b/app/client/modules/pix2pixhd/pix2pixhd.reducer.js
index a21f4d5..b6264ed 100644
--- a/app/client/modules/pix2pixhd/pix2pixhd.reducer.js
+++ b/app/client/modules/pix2pixhd/pix2pixhd.reducer.js
@@ -7,6 +7,7 @@ const pix2pixhdInitialState = {
error: null,
folder_id: 0,
data: null,
+ results: null,
}
const pix2pixhdReducer = (state = pix2pixhdInitialState, action) => {
@@ -15,6 +16,11 @@ const pix2pixhdReducer = (state = pix2pixhdInitialState, action) => {
}
switch (action.type) {
+ case types.pix2pixhd.load_results:
+ return {
+ ...state,
+ results: action.results,
+ }
default:
return state
}
diff --git a/app/client/modules/pix2pixhd/views/pix2pixhd.results.js b/app/client/modules/pix2pixhd/views/pix2pixhd.results.js
index cf0bdf7..ac0bb74 100644
--- a/app/client/modules/pix2pixhd/views/pix2pixhd.results.js
+++ b/app/client/modules/pix2pixhd/views/pix2pixhd.results.js
@@ -16,37 +16,57 @@ class Pix2pixHDResults extends Component {
if (!props.pix2pixhd.results) props.actions.load_results()
}
render(){
- if (this.props.pix2pixhd.loading) return <Loading progress={this.props.pix2pixhd.progress} />
- // const { folderLookup, fileLookup, datasetLookup } = this.props.samplernn.data
-
- // console.log(bestRenders.map(r => r.epoch))
- // const path = folder.name === 'unsorted'
- // ? "/samplernn/import/"
- // : "/samplernn/datasets/" + folder.id + "/"
- // return (
- // <div className='col bestRenders'>
- // <h3><Link to={path}>{folder.name}</Link></h3>
- // <FileList
- // linkFiles
- // files={bestRenders}
- // orderBy='date desc'
- // fields={'name date epoch size'}
- // onClick={(file, e) => {
- // e.preventDefault()
- // e.stopPropagation()
- // console.log('picked a file', file)
- // this.handlePick(file)
- // }}
- // />
- // </div>
- // )
+ if (! this.props.pix2pixhd.results) return <Loading progress={this.props.pix2pixhd.progress} />
+ const { 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}
+ orderBy='date desc'
+ fields={'name date count'}
+ onClick={(file, e) => {
+ e.preventDefault()
+ e.stopPropagation()
+ console.log('picked a result', file)
+ this.handlePick(file)
+ }}
+ />
+
+ <h3>renders</h3>
+ <FileList
+ files={renders}
+ orderBy='date desc'
+ fields={'name date size'}
+ onClick={(file, e) => {
+ e.preventDefault()
+ e.stopPropagation()
+ console.log('picked a result', file)
+ this.handlePick(file)
+ }}
+ />
+
+ <h3>files</h3>
+ <FileList
+ linkFiles
+ files={files}
+ orderBy='date desc'
+ fields={'name date size'}
+ onClick={(file, e) => {
+ e.preventDefault()
+ e.stopPropagation()
+ console.log('picked a result', file)
+ this.handlePick(file)
+ }}
+ />
+
</div>
</div>
)
diff --git a/app/relay/runner.js b/app/relay/runner.js
index 06fa85e..705d0c1 100644
--- a/app/relay/runner.js
+++ b/app/relay/runner.js
@@ -212,7 +212,11 @@ export function list_sequence(opt, f, root_dir) {
count: 0,
}
readdir(path.join(root_dir, f.name)).then(files => {
+ if (! files.length) {
+ return resolve(sequence)
+ }
const middle_file = files[Math.floor(files.length/2)]
+ if (! middle_file) return resolve(sequence)
sequence.frame = {
prefix: middle_file.split('_')[0],
}