PyTorch-YOLOv3/utils/augmentations.py

10 lines
207 B
Python
Raw Permalink Normal View History

2023-03-03 11:31:50 +08:00
import torch
import torch.nn.functional as F
import numpy as np
def horisontal_flip(images, targets):
images = torch.flip(images, [-1])
targets[:, 2] = 1 - targets[:, 2]
return images, targets