def test_frcnn_estimator():
    from gluoncv.auto.estimators import FasterRCNNEstimator
    est = FasterRCNNEstimator({'train': {'epochs': 1}, 'gpus': list(range(get_gpu_count()))})
    OBJECT_DETECTION_TRAIN_MINI, OBJECT_DETECTION_VAL_MINI, OBJECT_DETECTION_TEST_MINI = OBJECT_DETECTION_TRAIN.random_split(
        val_size=0.3, test_size=0.2)
    res = est.fit(OBJECT_DETECTION_TRAIN_MINI)
    assert res.get('valid_map', 0) > 0
    test_result = est.predict(OBJECT_DETECTION_TEST_MINI)
    est.predict(OBJECT_DETECTION_TEST.iloc[0]['image'])
    with Image.open(OBJECT_DETECTION_TEST.iloc[0]['image']) as pil_image:
        est.predict(pil_image)
    evaluate_result = est.evaluate(OBJECT_DETECTION_VAL_MINI)
    # test save/load
    _save_load_test(est, 'frcnn.pkl')
Beispiel #2
0
def test_frcnn_estimator():
    from gluoncv.auto.estimators import FasterRCNNEstimator
    est = FasterRCNNEstimator({'train': {'epochs': 1}, 'gpus': list(range(get_gpu_count()))})
    res = est.fit(OBJECT_DETCTION_DATASET)
    assert res.get('valid_map', 0) > 0
    _, _, test_data = OBJECT_DETCTION_DATASET.random_split()
    test_result = est.predict(test_data)
    evaluate_result = est.evaluate(test_data)
Beispiel #3
0
def test_frcnn_estimator():
    from gluoncv.auto.estimators import FasterRCNNEstimator
    est = FasterRCNNEstimator({
        'train': {
            'epochs': 1
        },
        'gpus': list(range(get_gpu_count()))
    })
    OBJECT_DETECTION_TRAIN_MINI, OBJECT_DETECTION_VAL_MINI, OBJECT_DETECTION_TEST_MINI = OBJECT_DETECTION_TRAIN.random_split(
        val_size=0.3, test_size=0.2)
    res = est.fit(OBJECT_DETECTION_TRAIN_MINI)
    assert res.get('valid_map', 0) > 0
    test_result = est.predict(OBJECT_DETECTION_TEST_MINI)
    evaluate_result = est.evaluate(OBJECT_DETECTION_VAL_MINI)