Skip to content

Instantly share code, notes, and snippets.

View yerkbn's full-sized avatar
🎯
Focusing

yerkbn

🎯
Focusing
  • «JIGI» LLP
  • Almaty
View GitHub Profile
while True:
# Grab a single frame of video
ret, frame = video_capture.read()
# Resize frame of video to 1/4 size for faster face recognition processing
small_frame = cv2.resize(frame, (0, 0), fx=QUALITY, fy=QUALITY)
# Convert the image from BGR color (which OpenCV uses) to RGB color (which face_recognition uses)
rgb_small_frame = small_frame[:, :, ::-1]
def video_parser(video_name = "videos/{}".format("vid1.mp4")):
video_capture = cv2.VideoCapture(video_name)
OFFSET = 50
OFFSET_TOP = 100
QUALITY = 0.25
CLASSES = {
"lannister": ['tyrion', 'cersei', 'jaime', 'joffery', 'myrcella', 'tommen', 'tywin'],
#-----------------------
import numpy as np
import cv2
import face_recognition
export async function onResultFetching(img){
return async (dispatch) => {
dispatch(onResultPending())
URL = HOSTS[0]
result_obj = {
result: {
class: 'Loading...'
},
resultLoading: false,
isError: false
{
"axios": "^0.18.0",
"expo": "^32.0.0",
"form-data": "^2.3.3",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
"react-native-elements": "^1.1.0",
"react-navigation": "^3.6.0",
"react-redux": "^6.0.0",
"redux": "^4.0.1",
from django.urls import path
from . import views
urlpatterns = [
path('classify/', views.classify),
]
from rest_framework.response import Response
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny
from rest_framework.status import (
HTTP_200_OK,
HTTP_400_BAD_REQUEST,
)
from .classification_research.CNN import CNN
import cv2
import numpy as np
import os
import tflearn
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.estimator import regression
# Here we set model configuration It all defined at the beginig
model.fit(
{'input': X},
{'targets': Y},
n_epoch=EPOCHE,
validation_set=({'input': test_x}, {'targets': test_y}),
snapshot_step=500, show_metric=True, run_id=MODEL_NAME
)
model.save(MODEL_NAME)
import tflearn
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.estimator import regression
convnet = input_data(shape=[None, IMG_SIZE, IMG_SIZE, 1], name='input')
#layer
convnet = conv_2d(convnet, 32, 2, activation='relu')