This file contains hidden or 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 dlib | |
| import numpy as np | |
| initial_image = cv2.imread('images/image9.jpg') | |
| initial_image_in_rgb = cv2.cvtColor(initial_image, cv2.COLOR_BGR2RGB) | |
| reference_image = initial_image_in_rgb.copy() | |
| classifier_path = dlib.shape_predictor('classifier/shape_predictor_68_face_landmarks.dat') | |
| frontal_face_detector = dlib.get_frontal_face_detector() |
This file contains hidden or 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 | |
| group_of_people_image = cv2.imread('images/image7.jpg') | |
| frontal_face_classifier = cv2.CascadeClassifier('classifier/haarcascade_frontalface_default.xml') | |
| image_in_gray_scale = cv2.cvtColor(group_of_people_image, cv2.COLOR_BGR2GRAY) | |
| faces = frontal_face_classifier.detectMultiScale(image=image_in_gray_scale, scaleFactor=1.3, minNeighbors=6) | |
| for (x_axis, y_axis, weight, height) in faces: | |
| cv2.rectangle(group_of_people_image, (x_axis, y_axis), (x_axis + weight, y_axis + height), (255, 0, 0), 2) |
This file contains hidden or 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
| f = open('workfile' ,'w') | |
| new_content = 'someContent' | |
| f.write(new_content) | |
| f.flush() | |
| ... |
This file contains hidden or 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
| f = open('workfile' ,'w') | |
| new_content = 'someContent' | |
| f.write(new_content) | |
| f.seek(0) | |
| line = f.readline() | |
| print line | |
| >> someContent |
This file contains hidden or 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
| f = open('workfile' ,'w') | |
| new_content = 'someContent' | |
| f.write(new_content) |
This file contains hidden or 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
| file_content = open('dados/some_sb.csv', encoding='utf-8', mode='w') | |
| new_content = '1,someContent' | |
| file_content.write(new_content) |
This file contains hidden or 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
| f = open('workfile' ,'r') | |
| f.readline() | |
| f.readlines() | |
| f.read() |
This file contains hidden or 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
| file_content = open('dados/some_sb.csv', encoding='utf-8', mode='w') | |
| new_content = '1,someContent' | |
| file_content.write(new_content) |
This file contains hidden or 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
| f = open('workfile' ,'r', encoding='utf-8') |
This file contains hidden or 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 elasticsearch | |
| import elasticsearch_dsl | |
| from elasticsearch_dsl.connections import connections, get_connection | |
| import config as config_module | |
| config = config_module.get_config() | |
NewerOlder