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
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] |
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
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'], | |
#----------------------- |
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 | |
import face_recognition |
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
export async function onResultFetching(img){ | |
return async (dispatch) => { | |
dispatch(onResultPending()) | |
URL = HOSTS[0] | |
result_obj = { | |
result: { | |
class: 'Loading...' | |
}, | |
resultLoading: false, | |
isError: false |
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
{ | |
"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", |
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 django.urls import path | |
from . import views | |
urlpatterns = [ | |
path('classify/', views.classify), | |
] |
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 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 |
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 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 |
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
# 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) |
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 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') |
NewerOlder