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

React UI fix: Failed to execute removChild.. #1405

Merged
merged 1 commit into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion cvat-ui/src/utils/dextr-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ const plugin: DEXTRPlugin = {
// eslint-disable-next-line no-param-reassign
self.data.canceled = false;
antModalButton.disabled = true;
document.body.removeChild(antModalRoot);
if (antModalRoot.parentElement === document.body) {
document.body.removeChild(antModalRoot);
}
}
},
},
Expand Down
6 changes: 3 additions & 3 deletions cvat/apps/dextr_segmentation/dextr.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def handle(self, db_data, frame, points):
points = np.asarray([[int(p["x"]), int(p["y"])] for p in points], dtype=int)

# Padding mustn't be more than the closest distance to an edge of an image
[width, height] = numpy_image.shape[:2]
[height, width] = numpy_image.shape[:2]
x_values = points[:, 0]
y_values = points[:, 1]
[min_x, max_x] = [np.min(x_values), np.max(x_values)]
Expand All @@ -59,8 +59,8 @@ def handle(self, db_data, frame, points):
bounding_box = (
max(min(points[:, 0]) - padding, 0),
max(min(points[:, 1]) - padding, 0),
min(max(points[:, 0]) + padding, numpy_image.shape[1] - 1),
min(max(points[:, 1]) + padding, numpy_image.shape[0] - 1)
min(max(points[:, 0]) + padding, width - 1),
min(max(points[:, 1]) + padding, height - 1)
)

# Prepare an image
Expand Down