Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CropModel should return labels not numeric values. #705

Open
bw4sz opened this issue Jul 3, 2024 · 1 comment
Open

CropModel should return labels not numeric values. #705

bw4sz opened this issue Jul 3, 2024 · 1 comment
Labels
API This tag is used for small improvements to the readability and usability of the python API. Feature Request New feature or request good first issue Good for newcomers
Milestone

Comments

@bw4sz
Copy link
Collaborator

bw4sz commented Jul 3, 2024

CropModel should return labels not numeric values.

    raster_path = get_data("SOAP_061.png")
    patch_size = 400
    patch_overlap = 0.05
    iou_threshold = 0.15
    return_plot = False
    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,
                                           return_plot=return_plot,
                                           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","cropmodel_score","image_path"}

cropmodel_label here is 0 or 1. I think that it should better match result["label"] from the detection as being a string. Users will be happier.

@bw4sz bw4sz added Feature Request New feature or request good first issue Good for newcomers API This tag is used for small improvements to the readability and usability of the python API. labels Jul 3, 2024
@ethanwhite ethanwhite added this to the 1.4 release milestone Oct 1, 2024
@bw4sz
Copy link
Collaborator Author

bw4sz commented Oct 1, 2024

This is related to main.predict_file returning numeric arrays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API This tag is used for small improvements to the readability and usability of the python API. Feature Request New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants