diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-07 02:00:29 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-07 02:00:29 +0200 |
| commit | 798a9f835899103d79397a9461ff933d4000634c (patch) | |
| tree | 5705cdf30cdef83846bf36878b8201e98c282bb8 /public/bundle.js | |
| parent | f7d19d22c70b9f8bc879243729eda76f6d66c805 (diff) | |
ughhh
Diffstat (limited to 'public/bundle.js')
| -rw-r--r-- | public/bundle.js | 125 |
1 files changed, 59 insertions, 66 deletions
diff --git a/public/bundle.js b/public/bundle.js index 65b11e2..3d50d97 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -6581,27 +6581,9 @@ var _redux = __webpack_require__(/*! redux */ "./node_modules/redux/es/redux.js" var _reactRedux = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); -var _player = __webpack_require__(/*! ../../../common/player.component */ "./app/client/common/player.component.js"); +var _common = __webpack_require__(/*! ../../../common/ */ "./app/client/common/index.js"); -var _player2 = _interopRequireDefault(_player); - -var _paramGroup = __webpack_require__(/*! ../../../common/paramGroup.component */ "./app/client/common/paramGroup.component.js"); - -var _paramGroup2 = _interopRequireDefault(_paramGroup); - -var _slider = __webpack_require__(/*! ../../../common/slider.component */ "./app/client/common/slider.component.js"); - -var _slider2 = _interopRequireDefault(_slider); - -var _select = __webpack_require__(/*! ../../../common/select.component */ "./app/client/common/select.component.js"); - -var _select2 = _interopRequireDefault(_select); - -var _button = __webpack_require__(/*! ../../../common/button.component */ "./app/client/common/button.component.js"); - -var _button2 = _interopRequireDefault(_button); - -var _player3 = __webpack_require__(/*! ../../../live/player */ "./app/client/live/player.js"); +var _player = __webpack_require__(/*! ../../../live/player */ "./app/client/live/player.js"); var _live = __webpack_require__(/*! ../../../live/live.actions */ "./app/client/live/live.actions.js"); @@ -6611,9 +6593,11 @@ var _pix2pix = __webpack_require__(/*! ../pix2pix.tasks */ "./app/client/modules var pix2pixTasks = _interopRequireWildcard(_pix2pix); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +var _pix2pix2 = __webpack_require__(/*! ../pix2pix.actions */ "./app/client/modules/pix2pix/pix2pix.actions.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var pix2pixActions = _interopRequireWildcard(_pix2pix2); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -6629,9 +6613,12 @@ var Pix2PixLive = function (_Component) { var _this = _possibleConstructorReturn(this, (Pix2PixLive.__proto__ || Object.getPrototypeOf(Pix2PixLive)).call(this)); + if (!props.pix2pix || !props.pix2pix.data) { + props.pix2pixActions.load_directories(); + } props.actions.get_params(); - props.actions.list_checkpoints(); - props.actions.list_sequences(); + // props.actions.list_checkpoints() + // props.actions.list_sequences() _this.changeCheckpoint = _this.changeCheckpoint.bind(_this); _this.changeEpoch = _this.changeEpoch.bind(_this); _this.changeSequence = _this.changeSequence.bind(_this); @@ -6693,19 +6680,23 @@ var Pix2PixLive = function (_Component) { key: 'toggleRecording', value: function toggleRecording() { if (this.props.opt.recording) { - (0, _player3.stopRecording)(); + (0, _player.stopRecording)(); this.props.actions.pause(); } else { - (0, _player3.startRecording)(); + (0, _player.startRecording)(); } } }, { key: 'render', value: function render() { + console.log(this.props); + if (this.props.pix2pix.loading) { + return (0, _preact.h)(_common.Loading, null); + } return (0, _preact.h)( 'div', { className: 'app centered' }, - (0, _preact.h)(_player2.default, { width: 424, height: 256 }), + (0, _preact.h)(_common.Player, { width: 424, height: 256 }), (0, _preact.h)( 'div', { className: 'params row' }, @@ -6713,36 +6704,36 @@ var Pix2PixLive = function (_Component) { 'div', { className: 'column' }, (0, _preact.h)( - _paramGroup2.default, + _common.ParamGroup, { title: 'Playback', noToggle: true }, - (0, _preact.h)(_select2.default, { + (0, _preact.h)(_common.Select, { name: 'send_image', title: 'view mode', options: ['a', 'b', 'sequence', 'recursive'], onChange: this.props.actions.set_param }), - (0, _preact.h)(_select2.default, { + (0, _preact.h)(_common.Select, { name: 'sequence_name', title: 'sequence', - options: this.props.sequences, + options: this.props.pix2pix.data.sequences, onChange: this.changeSequence }), - (0, _preact.h)(_select2.default, { + (0, _preact.h)(_common.Select, { name: 'checkpoint_name', title: 'checkpoint', - options: this.props.checkpoints, + options: this.props.pix2pix.data.checkpoints, onChange: this.changeCheckpoint }), - (0, _preact.h)(_select2.default, { + (0, _preact.h)(_common.Select, { name: 'epoch', title: 'epoch', options: this.props.epochs, onChange: this.changeEpoch }), - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'position', min: 0.0, max: 1.0, type: 'float', value: (this.props.frame.sequence_i || 0) / (this.props.frame.sequence_len || 1), @@ -6750,7 +6741,7 @@ var Pix2PixLive = function (_Component) { }), this.renderRestartButton(), (0, _preact.h)( - _button2.default, + _common.Button, { title: this.props.opt.savingVideo ? 'Saving video...' : this.props.opt.recording ? 'Recording (' + timeInSeconds(this.props.opt.recordFrames) + ')' : 'Record video', onClick: this.toggleRecording @@ -6758,10 +6749,10 @@ var Pix2PixLive = function (_Component) { this.props.opt.savingVideo ? 'Saving' : this.props.opt.recording ? 'Recording' : 'Record' ), (0, _preact.h)( - _button2.default, + _common.Button, { title: 'Save frame', - onClick: _player3.saveFrame + onClick: _player.saveFrame }, 'Save' ) @@ -6771,54 +6762,54 @@ var Pix2PixLive = function (_Component) { 'div', { className: 'column' }, (0, _preact.h)( - _paramGroup2.default, + _common.ParamGroup, { title: 'Transition', name: 'transition' }, - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'transition_period', min: 10, max: 5000, type: 'int' }), - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'transition_min', min: 0.001, max: 0.2, type: 'float' }), - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'transition_max', min: 0.1, max: 1.0, type: 'float' }) ), (0, _preact.h)( - _paramGroup2.default, + _common.ParamGroup, { title: 'Recursion', name: 'recursive' }, - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'recursive_frac', min: 0.0, max: 0.5, type: 'float' }), - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'recurse_roll', min: -64, max: 64, type: 'int' }), - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'recurse_roll_axis', min: 0, max: 1, type: 'int' }) ), (0, _preact.h)( - _paramGroup2.default, + _common.ParamGroup, { title: 'Sequence', name: 'sequence' }, - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'sequence_frac', min: 0.0, max: 0.5, type: 'float' }), - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'process_frac', min: 0, max: 1, type: 'float' }) @@ -6828,57 +6819,57 @@ var Pix2PixLive = function (_Component) { 'div', { className: 'column' }, (0, _preact.h)( - _paramGroup2.default, + _common.ParamGroup, { title: 'Clahe', name: 'clahe' }, - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'clip_limit', min: 1.0, max: 4.0, type: 'float' }) ), (0, _preact.h)( - _paramGroup2.default, + _common.ParamGroup, { title: 'Posterize', name: 'posterize' }, - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'spatial_window', min: 2, max: 128, type: 'int' }), - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'color_window', min: 2, max: 128, type: 'int' }) ), (0, _preact.h)( - _paramGroup2.default, + _common.ParamGroup, { title: 'Blur', name: 'blur' }, - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'blur_radius', min: 3, max: 7, type: 'odd' }), - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'blur_sigma', min: 0, max: 2, type: 'float' }) ), (0, _preact.h)( - _paramGroup2.default, + _common.ParamGroup, { title: 'Canny Edge Detection', name: 'canny' }, - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'canny_lo', min: 10, max: 200, type: 'int' }), - (0, _preact.h)(_slider2.default, { live: true, + (0, _preact.h)(_common.Slider, { live: true, name: 'canny_hi', min: 10, max: 200, type: 'int' }) @@ -6892,7 +6883,7 @@ var Pix2PixLive = function (_Component) { value: function renderRestartButton() { if (this.props.runner.gpu.status === 'IDLE') { return (0, _preact.h)( - _button2.default, + _common.Button, { title: 'GPU Idle', onClick: this.start @@ -6902,7 +6893,7 @@ var Pix2PixLive = function (_Component) { } if (this.props.runner.gpu.task.module !== 'pix2pix') { return (0, _preact.h)( - _button2.default, + _common.Button, { title: 'GPU Busy', onClick: this.kill @@ -6912,7 +6903,7 @@ var Pix2PixLive = function (_Component) { } if (!this.props.opt.processing) { return (0, _preact.h)( - _button2.default, + _common.Button, { title: 'Not processing', onClick: this.togglePlaying @@ -6921,7 +6912,7 @@ var Pix2PixLive = function (_Component) { ); } return (0, _preact.h)( - _button2.default, + _common.Button, { title: 'Processing', onClick: this.togglePlaying @@ -6944,13 +6935,15 @@ var mapStateToProps = function mapStateToProps(state) { checkpoints: state.live.checkpoints, epochs: state.live.epochs, sequences: state.live.sequences, - runner: state.system.runner + runner: state.system.runner, + pix2pix: state.module.pix2pix }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { return { - actions: (0, _redux.bindActionCreators)(liveActions, dispatch) + actions: (0, _redux.bindActionCreators)(liveActions, dispatch), + pix2pixActions: (0, _redux.bindActionCreators)(pix2pixActions, dispatch) }; }; |
