@@ -79,7 +79,7 @@ public void TrainModel(double ratio, int passes)
7979 if ( ! list . Any ( x => x . name == _modelName ) )
8080 {
8181 MyLog ( "No models found, trying to load saved model..." ) ;
82- if ( File . Exists ( _modelName + ".machinebox.classificationbox" ) )
82+ if ( File . Exists ( Path . Combine ( _basePath , _modelName + ".machinebox.classificationbox" ) ) )
8383 {
8484 svc . LoadModel ( Path . Combine ( _basePath , _modelName + ".machinebox.classificationbox" ) ) ;
8585 ret = svc . ListModels ( ) ;
@@ -151,7 +151,7 @@ public void ClassifyImages(string imagesPath, double threshold)
151151 if ( ! list . Any ( x => x . name == _modelName ) )
152152 {
153153 MyLog ( "No models found, trying to load saved model..." ) ;
154- if ( File . Exists ( _modelName + ".machinebox.classificationbox" ) )
154+ if ( File . Exists ( Path . Combine ( _basePath , _modelName + ".machinebox.classificationbox" ) ) )
155155 {
156156 svc . LoadModel ( Path . Combine ( _basePath , _modelName + ".machinebox.classificationbox" ) ) ;
157157 ret = svc . ListModels ( ) ;
@@ -189,9 +189,12 @@ public void ClassifyImages(string imagesPath, double threshold)
189189 protected List < FileEntry > LoadFiles ( string basePath )
190190 {
191191 MyLog ( "Reading files..." ) ;
192+ var ignoredExts = new List < string > ( ) { ".mp4" , ".mp3" , ".json" } ;
192193 var list = new List < FileEntry > ( ) ;
193194 foreach ( var filename in Directory . GetFiles ( basePath ) )
194195 {
196+ if ( ignoredExts . Contains ( Path . GetExtension ( filename ) . ToLower ( ) ) ) continue ;
197+
195198 list . Add ( new FileEntry ( ) { fn = filename } ) ;
196199 }
197200 return list ;
0 commit comments