Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin Ennemoser NMO13

View GitHub Profile
View anchor_vis.py
from PIL import Image, ImageFont, ImageDraw, ImageEnhance
import torchvision.transforms.functional as F
# image is the tensor defined as torch.zeros((3, 800, 800)).float()
## visualize all centers and boxes for 1 position
pil_image = F.to_pil_image(image)
draw = ImageDraw.Draw(pil_image)
for anchor in anchor_base:
draw.rectangle(((anchor[1], anchor[0]), (anchor[3], anchor[2])))
You can’t perform that action at this time.