예제 #1
0
def Reset():
  """Reset the library. Useful for re-initializing to a different server."""
  data.reset()
  ApiFunction.reset()
  Image.reset()
  Feature.reset()
  Collection.reset()
  ImageCollection.reset()
  FeatureCollection.reset()
  Filter.reset()
  Geometry.reset()
  Number.reset()
  String.reset()
  _ResetGeneratedClasses()
  global Algorithms
  Algorithms = _AlgorithmsContainer()
예제 #2
0
def Reset():
  """Reset the library. Useful for re-initializing to a different server."""
  data.reset()
  ApiFunction.reset()
  Element.reset()
  Image.reset()
  Feature.reset()
  Collection.reset()
  ImageCollection.reset()
  FeatureCollection.reset()
  Filter.reset()
  Geometry.reset()
  Number.reset()
  String.reset()
  _ResetGeneratedClasses()
  global Algorithms
  Algorithms = _AlgorithmsContainer()
예제 #3
0
                        metavar="/path/to/numpy/image/file",
                        help='Path to numpy image file')
    parser.add_argument('--masks',
                        required=False,
                        metavar="/path/to/numpy/mask/file",
                        help='Path to numpy mask file')
    args = parser.parse_args()

    assert args.command in [
        'imgmask', 'img', 'split', 'reset'
    ], "command must be in ['imgmask', 'img', 'split', 'reset']"

    train_directory = os.path.join(args.outdir, 'training_data')
    test_directory = os.path.join(args.outdir, 'testing_data')

    if args.command == 'imgmask':
        assert [args.images, args.masks
                ], 'imgmask requires the --images and --masks arguments'
        np_to_imgmask(args.images, args.masks, args.outdir)

    if args.command == 'img':
        assert args.images, "img requires the --images argument"
        np_to_img(args.images, args.outdir)

    if args.command == 'split':
        train_test_split(train_directory, test_directory, args.outdir,
                         TRAIN_PERCENT)

    if args.command == 'reset':
        reset(train_directory, test_directory, args.outdir)