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 ultralytics | |
from ultralytics import YOLO | |
import matplotlib.pyplot as plt | |
import cv2 | |
import numpy as np | |
print(ultralytics.__version__) | |
def crop_obb(image, obb): | |
""" Crop the Oriented Bounding Box (OBB) """ |
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 argparse | |
import collections | |
from functools import reduce, partial | |
from operator import getitem | |
from logger import setup_logging | |
from omegaconf import OmegaConf | |
class ConfigParser: |
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
wheelchair | |
truck | |
tree_trunk | |
traffic_sign | |
traffic_light | |
table | |
stroller | |
stop | |
scooter | |
potted_plant |
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 warnings | |
warnings.filterwarnings("ignore") | |
import tensorflow_datasets as tfds | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
# tfds works in both Eager and Graph modes | |
tf.compat.v1.enable_eager_execution() |
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 keras import backend as K | |
inp = model.input # input placeholder | |
outputs = [layer.output for layer in model.layers] # all layer outputs | |
functor = K.function([inp, K.learning_phase()], outputs ) # evaluation function | |
# Testing | |
test = x_test[0][np.newaxis,...] | |
layer_outs = functor([test, 1.]) | |
#print layer_outs |
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 os, tarfile, subprocess | |
import mxnet as mx | |
from mxnet import gluon, nd, image | |
from mxnet.gluon.data.vision import transforms | |
from gluoncv import utils | |
from gluoncv.model_zoo import get_model | |
import matplotlib.pyplot as plt | |
import numpy as np | |
# gluoncv 같은게 없다고 할 수 도 있는데 그럼 그냥 위에서 빼셈 ㅋ |
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 imgaug as ia | |
from imgaug import augmenters as iaa | |
ia.seed(1) | |
image = ia.quokka(size=(256, 256)) | |
bbs = ia.BoundingBoxesOnImage([ | |
ia.BoundingBox(x1=65, y1=100, x2=200, y2=150), | |
ia.BoundingBox(x1=150, y1=80, x2=200, y2=130) | |
], shape=image.shape) |
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 imgaug as ia | |
from imgaug import augmenters as iaa | |
ia.seed(1) | |
image = ia.quokka(size=(256, 256)) | |
bbs = ia.BoundingBoxesOnImage([ | |
ia.BoundingBox(x1=65, y1=100, x2=200, y2=150), | |
ia.BoundingBox(x1=150, y1=80, x2=200, y2=130) | |
], shape=image.shape) | |
seq = iaa.Sequential([ | |
iaa.Multiply((1.2, 1.5)), # change brightness, doesn't affect BBs |
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
void ReceiveImageFromDB() { | |
MYSQL *conn; | |
MYSQL_RES *result; | |
MYSQL_ROW row; | |
unsigned long *lengths; | |
conn = mysql_init(NULL); | |
mysql_real_connect(conn, "IP", "ID", "PASSWORD", "videosummary", PORT, NULL, 0); |
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 keras | |
import numpy as np | |
from keras.preprocessing.image import ImageDataGenerator | |
#data | |
data = np.array([[0,0,0],[10,10,10],[100,100,100]]) | |
print(data) | |
#ImageDataGenerator | |
expand_data = np.expand_dims(data, axis = 0) |
NewerOlder