This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cv2 | |
from albumentations.core.transforms_interface import DualTransform | |
class TopBiasedRandomCrop(DualTransform): | |
""" | |
Randomly crops an image so that the cropped region's width is at least min_width and its height is at least min_height | |
of the original. The vertical (y) offset is biased by sampling from a Beta distribution with parameters beta_alpha and beta_beta. | |
This transform also adjusts bounding boxes in [x_min, y_min, x_max, y_max] format. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# delete local tag '12345' | |
git tag -d <tagname> | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :<tagname> | |
# create local tag | |
git tag <tagname> | |
# push tag to remote | |
git push origin <tagname> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from collections import namedtuple | |
topk_namedtuple = namedtuple('topk_namedtuple', ['values', 'indices']) | |
def topk(array: np.ndarray, k: int, largest: bool = True) -> topk_namedtuple: | |
"""Returns the k largest/smallest elements and corresponding indices | |
from an array-like input. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import torch | |
import torch.nn as nn | |
import torch.optim as optim | |
import torchvision | |
from torchvision import transforms | |
from torch.ao.quantization import get_default_qat_qconfig_mapping | |
from torch.ao.quantization.quantize_fx import prepare_qat_fx, convert_fx |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.