if retcode is not 0:
                    failed+=1
            else:
                bagoftask.append((cmd, cls))
        
        if isSingleThreaded:
            print ""
        
        if not isSingleThreaded:
            # Take tasks and run parallel        
            multiProcessingTasks(config, bagoftask)
        
if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--cfg", default="dataset.cfg", help="Dataset config file name")
    parser.add_argument("--eye-correction", action="store_true", help="Apply eye correction to faces")
    parser.add_argument("--validation", action="store_true", help="true if it is validation")
    parser.add_argument("--single", action="store_true", help="Use Single Threaded process (slower but better for slow computer)")    
    parser.add_argument("dsFolder", help="Dataset base folder")
    args = parser.parse_args()
    try:
        config={}
        config=dcp.parse_ini_config(args.cfg)

        start_time = timeit.default_timer()
        dataset_cropFaces(args.dsFolder, config, args.eye_correction, args.single, validation=args.validation)
        print "Time Taken: {}".format(timeit.default_timer() - start_time)
    except Exception as e:
        print("ERR: something wrong (%s)" % str(e))
        sys.exit(1)
Example #2
0
            retcode = subprocess.call(args)
            if retcode is not 0:
                failed += 1
                #print("\nWARN: execution has returned error %d" % retcode)
        print ""


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--cfg",
                        default="dataset.cfg",
                        help="Dataset config file name")
    parser.add_argument("--eye-correction",
                        action="store_true",
                        help="Apply eye correction to faces")
    parser.add_argument("--validation",
                        action="store_true",
                        help="true if it is validation")
    parser.add_argument("dsFolder", help="Dataset base folder")
    args = parser.parse_args()
    try:
        config = {}
        config = dcp.parse_ini_config(args.cfg)
        dataset_cropFaces(args.dsFolder,
                          config,
                          args.eye_correction,
                          validation=args.validation)
    except Exception as e:
        print("ERR: something wrong (%s)" % str(e))
        sys.exit(1)
Example #3
0
            classificators.append(abs_f)

    args = [execut, config['FACECROP_FACE_DETECTOR_CFG']]
    if eye_detection:
        args.append(config['FACECROP_EYE_DETECTOR_CFG'])
    else:
        args.append('none')
    args += [
        config['SIZE']['width'], config['SIZE']['height'],
        config['GABOR_NWIDTHS'], config['GABOR_NLAMBDAS'],
        config['GABOR_NTHETAS'], mode_s
    ] + classificators

    print "Launching emogen gui! Smile :)"
    os.execv(execut, args)


if __name__ == "__main__":

    dsFolder = "my_dataset"
    cfg = "example_dataset.cfg"
    mode = "svm"

    try:
        config = {}
        config = dcp.parse_ini_config(cfg)
        launch_gui(dsFolder, config, mode, True)
    except Exception as e:
        print "ERR: something wrong (%s)" % str(e)
        sys.exit(1)
Example #4
0
    abs_f = os.path.join(class_dir, f)
    if os.path.isfile(abs_f):
      classificators.append(abs_f)

  args = [execut, config['FACECROP_FACE_DETECTOR_CFG']]
  if eye_detection:
    args.append(config['FACECROP_EYE_DETECTOR_CFG'])
  else:
    args.append('none')
  args += [config['SIZE']['width'], config['SIZE']['height'],
      config['GABOR_NWIDTHS'], config['GABOR_NLAMBDAS'],
      config['GABOR_NTHETAS'], mode_s] + classificators

  print "Launching emogen gui! Smile :)"
  os.execv(execut, args);


if __name__ == "__main__":

  dsFolder = "my_dataset"
  cfg = "example_dataset.cfg"
  mode = "svm"

  try:
    config = {}
    config = dcp.parse_ini_config(cfg)
    launch_gui(dsFolder, config, mode, True)
  except Exception as e:
    print "ERR: something wrong (%s)" % str(e)
    sys.exit(1)