@@ -208,7 +208,6 @@ function openPath(pathName, isDir) {
208208 try {
209209 var config = require ( `${ pathName } .json` ) ;
210210 saveState = JSON . stringify ( config ) ;
211-
212211 //restore config
213212 $ ( '#inputtags' ) . val ( config . inputTags ) ;
214213 config . inputTags . split ( "," ) . forEach ( tag => {
@@ -236,7 +235,6 @@ function openPath(pathName, isDir) {
236235 $ ( '.bootstrap-tagsinput' ) . last ( ) . removeClass ( "invalid" ) ;
237236
238237 videotagging = document . getElementById ( 'video-tagging' ) ; //find out why jquery doesn't play nice with polymer
239- videotagging . disableImageDir ( ) ;
240238 videotagging . regiontype = $ ( '#regiontype' ) . val ( ) ;
241239 videotagging . multiregions = 1 ;
242240 videotagging . regionsize = $ ( '#regionsize' ) . val ( ) ;
@@ -320,101 +318,6 @@ function openPath(pathName, isDir) {
320318 }
321319}
322320
323- //load image directory
324- function folderSelected ( path ) {
325- $ ( '#load-message' ) . hide ( ) ;
326- dialog . showOpenDialog ( {
327- filters : [ { name : 'Image Directory' } ] ,
328- properties : [ 'openDirectory' ]
329- } , function ( pathName ) {
330- if ( pathName ) openPath ( pathName [ 0 ] ) ;
331- else $ ( '#load-message' ) . show ( ) ;
332- } ) ;
333-
334- function openPath ( pathName ) {
335- var config ;
336-
337- // show configuration
338- $ ( '#load-message' ) . hide ( ) ;
339- $ ( '#video-tagging-container' ) . hide ( )
340- $ ( '#load-form-container' ) . show ( ) ;
341- $ ( '#framerateGroup' ) . hide ( ) ;
342-
343- //set title indicator
344- $ ( 'title' ) . text ( `Image Tagging Job Configuration: ${ pathJS . dirname ( pathName ) } ` ) ;
345-
346- $ ( '#inputtags' ) . tagsinput ( 'removeAll' ) ; //remove all previous tag labels
347- $ ( '#output' ) . val ( `${ basepath } /cntk` ) ;
348- $ ( '#model' ) . val ( `${ basepath } /cntk/Fast-RCNN.model` ) ;
349-
350- try {
351- config = require ( `${ pathName } /ImageTaggingConfig.json` ) ;
352- //restore tags
353- $ ( '#inputtags' ) . val ( config . inputTags ) ;
354- config . inputTags . split ( "," ) . forEach ( tag => {
355- $ ( "#inputtags" ) . tagsinput ( 'add' , tag ) ;
356- } ) ;
357- } catch ( e ) {
358- console . log ( `Error loading save file ${ e . message } ` ) ;
359- }
360-
361- // REPLACE implementation, use jQuery to remove all event handlers on loadbutton
362- document . getElementById ( 'loadButton' ) . parentNode . replaceChild ( document . getElementById ( 'loadButton' ) . cloneNode ( true ) , document . getElementById ( 'loadButton' ) ) ;
363- document . getElementById ( 'loadButton' ) . addEventListener ( 'click' , loadTagger ) ;
364-
365- function loadTagger ( e ) {
366- if ( inputtags . validity . valid ) {
367- $ ( '.bootstrap-tagsinput' ) . last ( ) . removeClass ( "invalid" ) ;
368-
369- $ ( 'title' ) . text ( `Image Tagging Job: ${ pathJS . dirname ( pathName ) } }` ) ; //set title indicator
370-
371- videotagging = document . getElementById ( 'video-tagging' ) ; //find out why jquery doesn't play nice with polymer
372- videotagging . regiontype = $ ( '#regiontype' ) . val ( ) ;
373- videotagging . multiregions = 1 ;
374- videotagging . regionsize = $ ( '#regionsize' ) . val ( ) ;
375- videotagging . inputtagsarray = $ ( '#inputtags' ) . val ( ) . split ( ',' ) ;
376- videotagging . video . currentTime = 0 ;
377- videotagging . videowidth = 854 ;
378- videotagging . videoheight = 480 ;
379- videotagging . framerate = $ ( '#framerate' ) . val ( ) ;
380-
381- //get list of images in directory
382- var files = fs . readdirSync ( pathName ) ;
383-
384- videotagging . imagelist = files . filter ( function ( file ) {
385- return file . match ( / .( j p g | j p e g | p n g | g i f ) $ / i) ;
386- } ) ;
387-
388- videotagging . imagelist = videotagging . imagelist . map ( ( filepath ) => { return pathJS . join ( pathName , filepath ) } ) ;
389- videotagging . src = pathName ;
390-
391- //track visited frames
392- videotagging . video . removeEventListener ( "canplay" , updateVisitedFrames ) ; //remove old listener
393- videotagging . video . addEventListener ( "canplay" , updateVisitedFrames ) ;
394-
395- //init cntk extensions
396- CNTKExtension = new VideoTaggingCNTKExtension ( {
397- videotagging : videotagging ,
398- cntkPath : cntkConfig . cntkPath ,
399- cntkEnv : cntkConfig . cntkEnv ,
400- visitedFrames : visitedFrames ,
401- exportUntil : $ ( '#exportTo' ) . val ( ) ,
402- exportPath : $ ( '#output' ) . val ( )
403- } ) ;
404-
405- $ ( '#load-form-container' ) . hide ( ) ;
406- $ ( '#video-tagging-container' ) . show ( ) ;
407-
408- ipcRenderer . send ( 'setFilePath' , pathName ) ;
409- } else {
410- $ ( '.bootstrap-tagsinput' ) . last ( ) . addClass ( "invalid" ) ;
411- }
412- }
413-
414- }
415- }
416-
417-
418321//saves current video to config
419322function save ( ) {
420323 var saveObject = {
0 commit comments