Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def prepare_tfdataset(annotations):
records_created = tfrecords.create_tfrecords(annotations_file=annotations, class_file="tests/data/classes.csv", image_min_side=800, backbone_model="resnet50", size=100, savedir="tests/data/")
assert os.path.exists("tests/data/testfile_deepforest_0.tfrecord")
return records_created
def test_create_tfrecords(config):
"""This test is in flux due to the fact that tensorflow and cv2 resize methods are not identical: https://jricheimer.github.io/tensorflow/2019/02/11/resize-confusion/ """
created_records = tfrecords.create_tfrecords(annotations_file="tests/data/testfile_tfrecords.csv",
class_file="tests/data/classes.csv",
image_min_side=config["image-min-side"],
backbone_model=config["backbone"],
size=100,
savedir="tests/data/")
assert os.path.exists("tests/data/testfile_tfrecords_0.tfrecord")
return created_records
def test_tfdataset_error(bad_annotations):
with pytest.raises(ValueError):
records_created = tfrecords.create_tfrecords(annotations_file=bad_annotations, class_file=get_data("classes.csv"), image_min_side=800, backbone_model="resnet50", size=100, savedir="tests/data/")