You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def test_predict_tile_with_crop_model_empty():
"""If the model return is empty, the crop model should return an empty dataframe"""
raster_path = get_data("SOAP_061.png")
m = main.deepforest()
patch_size = 400
patch_overlap = 0.05
iou_threshold = 0.15
mosaic = True
# Set up the crop model
crop_model = model.CropModel()
# Call the predict_tile method with the crop_model
m.config["train"]["fast_dev_run"] = False
m.create_trainer()
result = m.predict_tile(raster_path=raster_path,
patch_size=patch_size,
patch_overlap=patch_overlap,
iou_threshold=iou_threshold,
mosaic=mosaic,
crop_model=crop_model)
# Assert the result
assert isinstance(result, pd.DataFrame)
assert set(result.columns) == {
"xmin", "ymin", "xmax", "ymax", "label", "score", "cropmodel_label", "geometry",
"cropmodel_score", "image_path"
}
self = <deepforest.dataset.BoundingBoxDataset object at 0x1849afdd0>
df = Empty DataFrame
Columns: [xmin, ymin, xmax, ymax, label, score, image_path]
Index: []
root_dir = '/Users/benweinstein/Documents/DeepForest/src/deepforest/data'
transform = None, augment = False
def __init__(self, df, root_dir, transform=None, augment=False):
self.df = df
if transform is None:
self.transform = bounding_box_transform(augment=augment)
else:
self.transform = transform
unique_image = self.df['image_path'].unique()
> assert len(unique_image
) == 1, "There should be only one unique image for this class object"
E AssertionError: There should be only one unique image for this class object
I am assigning to myself and will fix shortly. I found it while working with the CropModel workflow. Just need to check for results.empty.
The text was updated successfully, but these errors were encountered:
I am assigning to myself and will fix shortly. I found it while working with the CropModel workflow. Just need to check for results.empty.
The text was updated successfully, but these errors were encountered: