Skip to content

Instantly share code, notes, and snippets.

View asmekal's full-sized avatar

Andrey Zharkov asmekal

View GitHub Profile

~~useful for interview

simple python

numbers

float('inf')
float('-inf')
# ^+-*/ and ><= etc work as expected, can lead to nan (e.g. inf-inf)
@asmekal
asmekal / albu_invert.py
Created May 22, 2024 03:54
invert some albumentations transforms
import numpy as np
import matplotlib.pyplot as plt
import cv2
import albumentations as A
class MaskInverter:
def __init__(self, original_shape):
self.original_shape = original_shape
def invert_horizontal_flip(self, mask):