Spaces:
Build error
Build error
File size: 612 Bytes
9b879f1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import numpy as np
from PIL import Image
from scipy.ndimage.filters import gaussian_filter
import cv2
import numpy as np
from scipy.ndimage import gaussian_filter
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
def mosaik(img,bboxes):
for box in bboxes:
#[y_min,y_max,x_min,x_max]) #
cropped=img[box[0]:box[1],box[2]:box[3],:]
cropped=np.array(cropped)
cropped = gaussian_filter(cropped, sigma=16)
img[box[0]:box[1],box[2]:box[3],:]=cropped
return img
|