Skip to content

Commit

Permalink
Test suite update - fix timeout issue
Browse files Browse the repository at this point in the history
  • Loading branch information
OlafenwaMoses committed Aug 15, 2019
1 parent ab2beaf commit 34c37a8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 182 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ script:
- wget -P data-models/ https://github.com/OlafenwaMoses/ImageAI/releases/download/1.0/yolo-tiny.h5
- wget -P data-models/ https://github.com/OlafenwaMoses/ImageAI/releases/download/essential-v4/pretrained-yolov3.h5
- wget -P data-models/ https://github.com/OlafenwaMoses/ImageAI/releases/download/essential-v4/hololens-ex-60--loss-2.76.h5
- pytest -m recognition -v
- pytest -v
after_success:
- codecov
- coverage
Expand Down
69 changes: 0 additions & 69 deletions test/test_custom_recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,72 +68,3 @@ def test_custom_recognition_model_densenet():
assert isinstance(predictions[0], str)
assert isinstance(probabilities[0], str)



@pytest.mark.recognition
@pytest.mark.resnet
@pytest.mark.recognition_custom
@pytest.mark.recognition_multi
def test_custom_recognition_model_resnet_multi():

predictor = CustomImagePrediction()
predictor.setModelTypeAsResNet()
predictor.setModelPath(os.path.join(main_folder, "data-models", "idenprof_resnet.h5"))
predictor.setJsonPath(model_json=os.path.join(main_folder, "data-json", "idenprof.json"))
predictor.loadModel(num_objects=10)
images_to_image_array()
result_array = predictor.predictMultipleImages(sent_images_array=all_images_array)

assert isinstance(result_array, list)
for result in result_array:
assert "predictions" in result
assert "percentage_probabilities" in result
assert isinstance(result["predictions"], list)
assert isinstance(result["percentage_probabilities"], list)
assert isinstance(result["predictions"][0], str)
assert isinstance(result["percentage_probabilities"][0], str)

@pytest.mark.recognition
@pytest.mark.resnet
@pytest.mark.recognition_custom
@pytest.mark.recognition_multi
def test_custom_recognition_full_model_resnet_multi():

predictor = CustomImagePrediction()
predictor.setModelPath(os.path.join(main_folder, "data-models", "idenprof_full_resnet_ex-001_acc-0.119792.h5"))
predictor.setJsonPath(model_json=os.path.join(main_folder, "data-json", "idenprof.json"))
predictor.loadFullModel(num_objects=10)
images_to_image_array()
result_array = predictor.predictMultipleImages(sent_images_array=all_images_array)

assert isinstance(result_array, list)
for result in result_array:
assert "predictions" in result
assert "percentage_probabilities" in result
assert isinstance(result["predictions"], list)
assert isinstance(result["percentage_probabilities"], list)
assert isinstance(result["predictions"][0], str)
assert isinstance(result["percentage_probabilities"][0], str)

@pytest.mark.recognition
@pytest.mark.densenet
@pytest.mark.recognition_custom
@pytest.mark.recognition_multi
def test_custom_recognition_model_densenet_multi():

predictor = CustomImagePrediction()
predictor.setModelTypeAsDenseNet()
predictor.setModelPath(os.path.join(main_folder, "data-models", "idenprof_densenet-0.763500.h5"))
predictor.setJsonPath(model_json=os.path.join(main_folder, "data-json", "idenprof.json"))
predictor.loadModel(num_objects=10)
images_to_image_array()
result_array = predictor.predictMultipleImages(sent_images_array=all_images_array)

assert isinstance(result_array, list)
for result in result_array:
assert "predictions" in result
assert "percentage_probabilities" in result
assert isinstance(result["predictions"], list)
assert isinstance(result["percentage_probabilities"], list)
assert isinstance(result["predictions"][0], str)
assert isinstance(result["percentage_probabilities"][0], str)
112 changes: 0 additions & 112 deletions test/test_image_recognition_multi_images.py

This file was deleted.

0 comments on commit 34c37a8

Please sign in to comment.