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

Fixed image source bug #132

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions samgeo/samgeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def save_prediction(

array = self.masks[index] * mask_multiplier
self.prediction = array
array_to_image(array, output, self.image, dtype=dtype, **kwargs)
array_to_image(array, output, self.source, dtype=dtype, **kwargs)

if vector is not None:
raster_to_vector(output, vector, simplify_tolerance=simplify_tolerance)
Expand Down Expand Up @@ -516,7 +516,7 @@ def predict(
point_labels = self.point_labels

if point_crs is not None:
point_coords = coords_to_xy(self.image, point_coords, point_crs)
point_coords = coords_to_xy(self.source, point_coords, point_crs)

if isinstance(point_coords, list):
point_coords = np.array(point_coords)
Expand All @@ -537,7 +537,7 @@ def predict(
point_labels = np.array(point_labels)

if isinstance(box, list) and point_crs is not None:
box = np.array(bbox_to_xy(self.image, box, point_crs))
box = np.array(bbox_to_xy(self.source, box, point_crs))

predictor = self.predictor
masks, scores, logits = predictor.predict(
Expand Down