Similar shapes in the input image(left) are grouped into same clusters, using hu moments. Members of the same cluster are shown with same coloured bounding boxes in the output image(right).
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
from PIL import Image | |
import os, sys | |
import cv2 | |
import numpy as np | |
''' | |
Converts all images in a directory to '.npy' format. | |
Use np.save and np.load to save and load the images. | |
Use it for training your neural networks in ML/DL projects. | |
''' |
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
, | |
[ | |
[<]<+ | |
>>[>] | |
, | |
] | |
< | |
[.<] |
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
+++++ +++ | |
[ | |
> +++++ + | |
< - | |
] | |
>>> | |
,. | |
[ | |
[<]<+ | |
>>[>] |
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
+++++ +++++ initialize counter (cell #0) to 10 | |
[ set the next four cells to 70 100 30 and 10 respectively | |
> +++++ ++ add 7 to cell #1 | |
> +++++ +++++ add 10 to cell #2 | |
> +++ add 3 to cell #3 | |
> + add 1 to cell #4 | |
<<<< - decrement counter (cell #0) | |
] | |
> ++ . print 'H' (H = ASC (72)) |
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 time | |
import numba | |
from numba import jit | |
import numpy as np | |
#input matrices | |
matrix1 = np.random.rand(30,30) | |
matrix2 = np.random.rand(30,30) | |
rmatrix = np.zeros(shape=(30,30)) |
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 | |
from PIL import Image | |
from imageio import imsave | |
from skimage.util.shape import view_as_blocks | |
# Global shuffle key | |
map={} | |
''' | |
Args:- |
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
from PIL import Image | |
import os, sys | |
from scipy.misc import imsave | |
import cv2 | |
import numpy as np | |
import random | |
import argparse | |
''' | |
Creates synthetic images with custom backgrounds, using the default images and masks in the dataset. |
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 cv2 | |
cap = cv2.VideoCapture(0) | |
i=1 | |
while(True): | |
# Capture frame-by-frame | |
ret, frame = cap.read() | |
# Operations on the frame |
NewerOlder