Skip to content
Discussion options

You must be logged in to vote

It's fairly easy to replace a portion of an image with another. You would do this with: image[start_c:end_c, start_h:end_h, start_w:end_w, start_d:end_d] = inferred_image.

You mention that you're using SpatialCrop, which implies that you know the parameters of the cropped region, so can determine start_c, end_c, etc. However, you also mentioned that you're doing this as data augmentation, which might mean that you're doing some random cropping (e.g., RandSpatialCrop). In this case, you should be able to determined the cropping parameters by inspecting the image_transforms key in your data (assuming you are using dictionary transforms).

Let me know if this doesn't quite answer your question.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by danny4159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants