View exampl_setup.py
This file contains 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
# https://raw.githubusercontent.com/ternaus/retinaface/master/setup.py | |
import io | |
import os | |
import re | |
import sys | |
from shutil import rmtree | |
from typing import Tuple, List | |
from setuptools import Command, find_packages, setup |
View Retinaface_load_model.py
This file contains 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
# https://github.com/ternaus/retinaface/blob/master/retinaface/pre_trained_models.py | |
from collections import namedtuple | |
from torch.utils import model_zoo | |
from retinaface.predict_single import Model | |
model = namedtuple("model", ["url", "model"]) | |
models = { | |
"resnet50_2020-07-20": model( |
View gist:5a4e47d640f0731850297ba84e4e351e
This file contains 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 albumentations as A | |
transform = A.Compose([A.HorizontalFlip(p=0.5), | |
A.ShiftScaleRotate(border_mode=cv2.BORDER_CONSTANT, scale_limit=0.3, p=0.5)], | |
bbox_params=albu.BboxParams(format='pascal_voc', label_fields=['category_ids']), | |
keypoint_params=albu.KeypointParams(format='xy'), | |
additional_targets={ | |
"image1": "image", | |
"bboxes1": "bboxes", | |
"mask1": "mask", |
View gist:02f581143a9ebe4a89c1c690ab6736f9
This file contains 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 albumentations as A | |
transform = A.Compose([ | |
A.HorizontalFlip(p=0.5), | |
A.GridDistortion(p=0.5), | |
A.RandomCrop(height=1024, width=1024, p=0.5), | |
], p=1) | |
transformed = transform(image=image, masks=[mask, mask2]) |
View gist:a6a11847e3a1b0da41fc84de85476ef5
This file contains 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 albumentations as A | |
transform = A.Compose([ | |
A.HorizontalFlip(p=0.5), | |
A.ShiftScaleRotate(border_mode=cv2.BORDER_CONSTANT, | |
scale_limit=0.3, | |
rotate_limit=(10, 30), | |
p=0.5) | |
], p=1) |
View code_formatter.sh
This file contains 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
black . | |
isort |
View gist:19fffd7078f6e779e8f0534f34f0216f
This file contains 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 albumentations.augmentations.functional as F |