def test_crop_hint_response_dim(capsys, resource):
    snippets.crop_hint(resource('cat.jpg'))
    stdout, _ = capsys.readouterr()
    result = json.loads(stdout)
    crop_hint = result['responses'][0]
    crop_hint_annotation = crop_hint['cropHintsAnnotation']['cropHints'][0]
    confidence = crop_hint_annotation['confidence']

    assert 0.5 < confidence < 0.9
Esempio n. 2
0
def test_crop_hint_response_dim(capsys, resource):
    snippets.crop_hint(resource('cat.jpg'))
    stdout, _ = capsys.readouterr()
    result = json.loads(stdout)
    crop_hint = result['responses'][0]
    crop_hint_annotation = crop_hint['cropHintsAnnotation']['cropHints'][0]
    confidence = crop_hint_annotation['confidence']

    assert 0.5 < confidence < 0.9
def test_crop_hint_response_count(capsys, resource):
    snippets.crop_hint(resource('cat.jpg'))
    stdout, _ = capsys.readouterr()
    result = json.loads(stdout)
    assert len(result['responses']) == 1
Esempio n. 4
0
def test_crop_hint_response_count(capsys, resource):
    snippets.crop_hint(resource('cat.jpg'))
    stdout, _ = capsys.readouterr()
    result = json.loads(stdout)
    assert len(result['responses']) == 1
Esempio n. 5
0
def test_crop_hint_response_count(capsys):
    snippets.crop_hint(os.path.join(RESOURCES, 'cat.jpg'))
    stdout, _ = capsys.readouterr()
    result = json.loads(stdout)
    assert len(result['responses']) == 1