PyTorch-YOLOv3/utils/augmentations.py

10 lines
207 B
Python

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