repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens sequencelengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens sequencelengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ageitgey/face_recognition | examples/face_recognition_knn.py | train | def train(train_dir, model_save_path=None, n_neighbors=None, knn_algo='ball_tree', verbose=False):
"""
Trains a k-nearest neighbors classifier for face recognition.
:param train_dir: directory that contains a sub-directory for each known person, with its name.
(View in source code to see train_dir ex... | python | def train(train_dir, model_save_path=None, n_neighbors=None, knn_algo='ball_tree', verbose=False):
"""
Trains a k-nearest neighbors classifier for face recognition.
:param train_dir: directory that contains a sub-directory for each known person, with its name.
(View in source code to see train_dir ex... | [
"def",
"train",
"(",
"train_dir",
",",
"model_save_path",
"=",
"None",
",",
"n_neighbors",
"=",
"None",
",",
"knn_algo",
"=",
"'ball_tree'",
",",
"verbose",
"=",
"False",
")",
":",
"X",
"=",
"[",
"]",
"y",
"=",
"[",
"]",
"# Loop through each person in the ... | Trains a k-nearest neighbors classifier for face recognition.
:param train_dir: directory that contains a sub-directory for each known person, with its name.
(View in source code to see train_dir example tree structure)
Structure:
<train_dir>/
├── <person1>/
│ ├── <somename1>.... | [
"Trains",
"a",
"k",
"-",
"nearest",
"neighbors",
"classifier",
"for",
"face",
"recognition",
"."
] | c96b010c02f15e8eeb0f71308c641179ac1f19bb | https://github.com/ageitgey/face_recognition/blob/c96b010c02f15e8eeb0f71308c641179ac1f19bb/examples/face_recognition_knn.py#L46-L108 | train | Train a k - nearest neighbors classifier for face recognition. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
ageitgey/face_recognition | examples/face_recognition_knn.py | predict | def predict(X_img_path, knn_clf=None, model_path=None, distance_threshold=0.6):
"""
Recognizes faces in given image using a trained KNN classifier
:param X_img_path: path to image to be recognized
:param knn_clf: (optional) a knn classifier object. if not specified, model_save_path must be specified.
... | python | def predict(X_img_path, knn_clf=None, model_path=None, distance_threshold=0.6):
"""
Recognizes faces in given image using a trained KNN classifier
:param X_img_path: path to image to be recognized
:param knn_clf: (optional) a knn classifier object. if not specified, model_save_path must be specified.
... | [
"def",
"predict",
"(",
"X_img_path",
",",
"knn_clf",
"=",
"None",
",",
"model_path",
"=",
"None",
",",
"distance_threshold",
"=",
"0.6",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"X_img_path",
")",
"or",
"os",
".",
"path",
".",
"s... | Recognizes faces in given image using a trained KNN classifier
:param X_img_path: path to image to be recognized
:param knn_clf: (optional) a knn classifier object. if not specified, model_save_path must be specified.
:param model_path: (optional) path to a pickled knn classifier. if not specified, model_s... | [
"Recognizes",
"faces",
"in",
"given",
"image",
"using",
"a",
"trained",
"KNN",
"classifier"
] | c96b010c02f15e8eeb0f71308c641179ac1f19bb | https://github.com/ageitgey/face_recognition/blob/c96b010c02f15e8eeb0f71308c641179ac1f19bb/examples/face_recognition_knn.py#L111-L150 | train | Predicts faces in a given image using a KNN classifier. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
ageitgey/face_recognition | examples/face_recognition_knn.py | show_prediction_labels_on_image | def show_prediction_labels_on_image(img_path, predictions):
"""
Shows the face recognition results visually.
:param img_path: path to image to be recognized
:param predictions: results of the predict function
:return:
"""
pil_image = Image.open(img_path).convert("RGB")
draw = ImageDraw.... | python | def show_prediction_labels_on_image(img_path, predictions):
"""
Shows the face recognition results visually.
:param img_path: path to image to be recognized
:param predictions: results of the predict function
:return:
"""
pil_image = Image.open(img_path).convert("RGB")
draw = ImageDraw.... | [
"def",
"show_prediction_labels_on_image",
"(",
"img_path",
",",
"predictions",
")",
":",
"pil_image",
"=",
"Image",
".",
"open",
"(",
"img_path",
")",
".",
"convert",
"(",
"\"RGB\"",
")",
"draw",
"=",
"ImageDraw",
".",
"Draw",
"(",
"pil_image",
")",
"for",
... | Shows the face recognition results visually.
:param img_path: path to image to be recognized
:param predictions: results of the predict function
:return: | [
"Shows",
"the",
"face",
"recognition",
"results",
"visually",
"."
] | c96b010c02f15e8eeb0f71308c641179ac1f19bb | https://github.com/ageitgey/face_recognition/blob/c96b010c02f15e8eeb0f71308c641179ac1f19bb/examples/face_recognition_knn.py#L153-L181 | train | Show the face recognition results visually. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
ageitgey/face_recognition | face_recognition/api.py | _rect_to_css | def _rect_to_css(rect):
"""
Convert a dlib 'rect' object to a plain tuple in (top, right, bottom, left) order
:param rect: a dlib 'rect' object
:return: a plain tuple representation of the rect in (top, right, bottom, left) order
"""
return rect.top(), rect.right(), rect.bottom(), rect.left() | python | def _rect_to_css(rect):
"""
Convert a dlib 'rect' object to a plain tuple in (top, right, bottom, left) order
:param rect: a dlib 'rect' object
:return: a plain tuple representation of the rect in (top, right, bottom, left) order
"""
return rect.top(), rect.right(), rect.bottom(), rect.left() | [
"def",
"_rect_to_css",
"(",
"rect",
")",
":",
"return",
"rect",
".",
"top",
"(",
")",
",",
"rect",
".",
"right",
"(",
")",
",",
"rect",
".",
"bottom",
"(",
")",
",",
"rect",
".",
"left",
"(",
")"
] | Convert a dlib 'rect' object to a plain tuple in (top, right, bottom, left) order
:param rect: a dlib 'rect' object
:return: a plain tuple representation of the rect in (top, right, bottom, left) order | [
"Convert",
"a",
"dlib",
"rect",
"object",
"to",
"a",
"plain",
"tuple",
"in",
"(",
"top",
"right",
"bottom",
"left",
")",
"order"
] | c96b010c02f15e8eeb0f71308c641179ac1f19bb | https://github.com/ageitgey/face_recognition/blob/c96b010c02f15e8eeb0f71308c641179ac1f19bb/face_recognition/api.py#L32-L39 | train | Convert a dlib rect object to a plain tuple in ( top right bottom left | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
ageitgey/face_recognition | face_recognition/api.py | _trim_css_to_bounds | def _trim_css_to_bounds(css, image_shape):
"""
Make sure a tuple in (top, right, bottom, left) order is within the bounds of the image.
:param css: plain tuple representation of the rect in (top, right, bottom, left) order
:param image_shape: numpy shape of the image array
:return: a trimmed plain... | python | def _trim_css_to_bounds(css, image_shape):
"""
Make sure a tuple in (top, right, bottom, left) order is within the bounds of the image.
:param css: plain tuple representation of the rect in (top, right, bottom, left) order
:param image_shape: numpy shape of the image array
:return: a trimmed plain... | [
"def",
"_trim_css_to_bounds",
"(",
"css",
",",
"image_shape",
")",
":",
"return",
"max",
"(",
"css",
"[",
"0",
"]",
",",
"0",
")",
",",
"min",
"(",
"css",
"[",
"1",
"]",
",",
"image_shape",
"[",
"1",
"]",
")",
",",
"min",
"(",
"css",
"[",
"2",
... | Make sure a tuple in (top, right, bottom, left) order is within the bounds of the image.
:param css: plain tuple representation of the rect in (top, right, bottom, left) order
:param image_shape: numpy shape of the image array
:return: a trimmed plain tuple representation of the rect in (top, right, botto... | [
"Make",
"sure",
"a",
"tuple",
"in",
"(",
"top",
"right",
"bottom",
"left",
")",
"order",
"is",
"within",
"the",
"bounds",
"of",
"the",
"image",
"."
] | c96b010c02f15e8eeb0f71308c641179ac1f19bb | https://github.com/ageitgey/face_recognition/blob/c96b010c02f15e8eeb0f71308c641179ac1f19bb/face_recognition/api.py#L52-L60 | train | Trim the given CSS tuple to the bounds of the image. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
ageitgey/face_recognition | face_recognition/api.py | face_distance | def face_distance(face_encodings, face_to_compare):
"""
Given a list of face encodings, compare them to a known face encoding and get a euclidean distance
for each comparison face. The distance tells you how similar the faces are.
:param faces: List of face encodings to compare
:param face_to_compa... | python | def face_distance(face_encodings, face_to_compare):
"""
Given a list of face encodings, compare them to a known face encoding and get a euclidean distance
for each comparison face. The distance tells you how similar the faces are.
:param faces: List of face encodings to compare
:param face_to_compa... | [
"def",
"face_distance",
"(",
"face_encodings",
",",
"face_to_compare",
")",
":",
"if",
"len",
"(",
"face_encodings",
")",
"==",
"0",
":",
"return",
"np",
".",
"empty",
"(",
"(",
"0",
")",
")",
"return",
"np",
".",
"linalg",
".",
"norm",
"(",
"face_enco... | Given a list of face encodings, compare them to a known face encoding and get a euclidean distance
for each comparison face. The distance tells you how similar the faces are.
:param faces: List of face encodings to compare
:param face_to_compare: A face encoding to compare against
:return: A numpy ndar... | [
"Given",
"a",
"list",
"of",
"face",
"encodings",
"compare",
"them",
"to",
"a",
"known",
"face",
"encoding",
"and",
"get",
"a",
"euclidean",
"distance",
"for",
"each",
"comparison",
"face",
".",
"The",
"distance",
"tells",
"you",
"how",
"similar",
"the",
"f... | c96b010c02f15e8eeb0f71308c641179ac1f19bb | https://github.com/ageitgey/face_recognition/blob/c96b010c02f15e8eeb0f71308c641179ac1f19bb/face_recognition/api.py#L63-L75 | train | Given a list of face encodings compare them to a known face encoding and get a euclidean distance for each comparison face. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
ageitgey/face_recognition | face_recognition/api.py | load_image_file | def load_image_file(file, mode='RGB'):
"""
Loads an image file (.jpg, .png, etc) into a numpy array
:param file: image file name or file object to load
:param mode: format to convert the image to. Only 'RGB' (8-bit RGB, 3 channels) and 'L' (black and white) are supported.
:return: image contents as... | python | def load_image_file(file, mode='RGB'):
"""
Loads an image file (.jpg, .png, etc) into a numpy array
:param file: image file name or file object to load
:param mode: format to convert the image to. Only 'RGB' (8-bit RGB, 3 channels) and 'L' (black and white) are supported.
:return: image contents as... | [
"def",
"load_image_file",
"(",
"file",
",",
"mode",
"=",
"'RGB'",
")",
":",
"im",
"=",
"PIL",
".",
"Image",
".",
"open",
"(",
"file",
")",
"if",
"mode",
":",
"im",
"=",
"im",
".",
"convert",
"(",
"mode",
")",
"return",
"np",
".",
"array",
"(",
... | Loads an image file (.jpg, .png, etc) into a numpy array
:param file: image file name or file object to load
:param mode: format to convert the image to. Only 'RGB' (8-bit RGB, 3 channels) and 'L' (black and white) are supported.
:return: image contents as numpy array | [
"Loads",
"an",
"image",
"file",
"(",
".",
"jpg",
".",
"png",
"etc",
")",
"into",
"a",
"numpy",
"array"
] | c96b010c02f15e8eeb0f71308c641179ac1f19bb | https://github.com/ageitgey/face_recognition/blob/c96b010c02f15e8eeb0f71308c641179ac1f19bb/face_recognition/api.py#L78-L89 | train | Loads an image file into a numpy array. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
ageitgey/face_recognition | face_recognition/api.py | _raw_face_locations | def _raw_face_locations(img, number_of_times_to_upsample=1, model="hog"):
"""
Returns an array of bounding boxes of human faces in a image
:param img: An image (as a numpy array)
:param number_of_times_to_upsample: How many times to upsample the image looking for faces. Higher numbers find smaller face... | python | def _raw_face_locations(img, number_of_times_to_upsample=1, model="hog"):
"""
Returns an array of bounding boxes of human faces in a image
:param img: An image (as a numpy array)
:param number_of_times_to_upsample: How many times to upsample the image looking for faces. Higher numbers find smaller face... | [
"def",
"_raw_face_locations",
"(",
"img",
",",
"number_of_times_to_upsample",
"=",
"1",
",",
"model",
"=",
"\"hog\"",
")",
":",
"if",
"model",
"==",
"\"cnn\"",
":",
"return",
"cnn_face_detector",
"(",
"img",
",",
"number_of_times_to_upsample",
")",
"else",
":",
... | Returns an array of bounding boxes of human faces in a image
:param img: An image (as a numpy array)
:param number_of_times_to_upsample: How many times to upsample the image looking for faces. Higher numbers find smaller faces.
:param model: Which face detection model to use. "hog" is less accurate but fas... | [
"Returns",
"an",
"array",
"of",
"bounding",
"boxes",
"of",
"human",
"faces",
"in",
"a",
"image"
] | c96b010c02f15e8eeb0f71308c641179ac1f19bb | https://github.com/ageitgey/face_recognition/blob/c96b010c02f15e8eeb0f71308c641179ac1f19bb/face_recognition/api.py#L92-L105 | train | Returns an array of bounding boxes of human faces in a image. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
ageitgey/face_recognition | face_recognition/api.py | face_locations | def face_locations(img, number_of_times_to_upsample=1, model="hog"):
"""
Returns an array of bounding boxes of human faces in a image
:param img: An image (as a numpy array)
:param number_of_times_to_upsample: How many times to upsample the image looking for faces. Higher numbers find smaller faces.
... | python | def face_locations(img, number_of_times_to_upsample=1, model="hog"):
"""
Returns an array of bounding boxes of human faces in a image
:param img: An image (as a numpy array)
:param number_of_times_to_upsample: How many times to upsample the image looking for faces. Higher numbers find smaller faces.
... | [
"def",
"face_locations",
"(",
"img",
",",
"number_of_times_to_upsample",
"=",
"1",
",",
"model",
"=",
"\"hog\"",
")",
":",
"if",
"model",
"==",
"\"cnn\"",
":",
"return",
"[",
"_trim_css_to_bounds",
"(",
"_rect_to_css",
"(",
"face",
".",
"rect",
")",
",",
"... | Returns an array of bounding boxes of human faces in a image
:param img: An image (as a numpy array)
:param number_of_times_to_upsample: How many times to upsample the image looking for faces. Higher numbers find smaller faces.
:param model: Which face detection model to use. "hog" is less accurate but fas... | [
"Returns",
"an",
"array",
"of",
"bounding",
"boxes",
"of",
"human",
"faces",
"in",
"a",
"image"
] | c96b010c02f15e8eeb0f71308c641179ac1f19bb | https://github.com/ageitgey/face_recognition/blob/c96b010c02f15e8eeb0f71308c641179ac1f19bb/face_recognition/api.py#L108-L121 | train | Returns an array of bounding boxes of human faces in a image. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
ageitgey/face_recognition | face_recognition/api.py | batch_face_locations | def batch_face_locations(images, number_of_times_to_upsample=1, batch_size=128):
"""
Returns an 2d array of bounding boxes of human faces in a image using the cnn face detector
If you are using a GPU, this can give you much faster results since the GPU
can process batches of images at once. If you aren'... | python | def batch_face_locations(images, number_of_times_to_upsample=1, batch_size=128):
"""
Returns an 2d array of bounding boxes of human faces in a image using the cnn face detector
If you are using a GPU, this can give you much faster results since the GPU
can process batches of images at once. If you aren'... | [
"def",
"batch_face_locations",
"(",
"images",
",",
"number_of_times_to_upsample",
"=",
"1",
",",
"batch_size",
"=",
"128",
")",
":",
"def",
"convert_cnn_detections_to_css",
"(",
"detections",
")",
":",
"return",
"[",
"_trim_css_to_bounds",
"(",
"_rect_to_css",
"(",
... | Returns an 2d array of bounding boxes of human faces in a image using the cnn face detector
If you are using a GPU, this can give you much faster results since the GPU
can process batches of images at once. If you aren't using a GPU, you don't need this function.
:param img: A list of images (each as a num... | [
"Returns",
"an",
"2d",
"array",
"of",
"bounding",
"boxes",
"of",
"human",
"faces",
"in",
"a",
"image",
"using",
"the",
"cnn",
"face",
"detector",
"If",
"you",
"are",
"using",
"a",
"GPU",
"this",
"can",
"give",
"you",
"much",
"faster",
"results",
"since",... | c96b010c02f15e8eeb0f71308c641179ac1f19bb | https://github.com/ageitgey/face_recognition/blob/c96b010c02f15e8eeb0f71308c641179ac1f19bb/face_recognition/api.py#L135-L151 | train | Returns a 2d array of bounding boxes of human faces in a given image using the cnn face detectors. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
ageitgey/face_recognition | face_recognition/api.py | face_landmarks | def face_landmarks(face_image, face_locations=None, model="large"):
"""
Given an image, returns a dict of face feature locations (eyes, nose, etc) for each face in the image
:param face_image: image to search
:param face_locations: Optionally provide a list of face locations to check.
:param model:... | python | def face_landmarks(face_image, face_locations=None, model="large"):
"""
Given an image, returns a dict of face feature locations (eyes, nose, etc) for each face in the image
:param face_image: image to search
:param face_locations: Optionally provide a list of face locations to check.
:param model:... | [
"def",
"face_landmarks",
"(",
"face_image",
",",
"face_locations",
"=",
"None",
",",
"model",
"=",
"\"large\"",
")",
":",
"landmarks",
"=",
"_raw_face_landmarks",
"(",
"face_image",
",",
"face_locations",
",",
"model",
")",
"landmarks_as_tuples",
"=",
"[",
"[",
... | Given an image, returns a dict of face feature locations (eyes, nose, etc) for each face in the image
:param face_image: image to search
:param face_locations: Optionally provide a list of face locations to check.
:param model: Optional - which model to use. "large" (default) or "small" which only returns ... | [
"Given",
"an",
"image",
"returns",
"a",
"dict",
"of",
"face",
"feature",
"locations",
"(",
"eyes",
"nose",
"etc",
")",
"for",
"each",
"face",
"in",
"the",
"image"
] | c96b010c02f15e8eeb0f71308c641179ac1f19bb | https://github.com/ageitgey/face_recognition/blob/c96b010c02f15e8eeb0f71308c641179ac1f19bb/face_recognition/api.py#L168-L200 | train | Given an image returns a dict of face feature locations | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
ageitgey/face_recognition | face_recognition/api.py | face_encodings | def face_encodings(face_image, known_face_locations=None, num_jitters=1):
"""
Given an image, return the 128-dimension face encoding for each face in the image.
:param face_image: The image that contains one or more faces
:param known_face_locations: Optional - the bounding boxes of each face if you al... | python | def face_encodings(face_image, known_face_locations=None, num_jitters=1):
"""
Given an image, return the 128-dimension face encoding for each face in the image.
:param face_image: The image that contains one or more faces
:param known_face_locations: Optional - the bounding boxes of each face if you al... | [
"def",
"face_encodings",
"(",
"face_image",
",",
"known_face_locations",
"=",
"None",
",",
"num_jitters",
"=",
"1",
")",
":",
"raw_landmarks",
"=",
"_raw_face_landmarks",
"(",
"face_image",
",",
"known_face_locations",
",",
"model",
"=",
"\"small\"",
")",
"return"... | Given an image, return the 128-dimension face encoding for each face in the image.
:param face_image: The image that contains one or more faces
:param known_face_locations: Optional - the bounding boxes of each face if you already know them.
:param num_jitters: How many times to re-sample the face when cal... | [
"Given",
"an",
"image",
"return",
"the",
"128",
"-",
"dimension",
"face",
"encoding",
"for",
"each",
"face",
"in",
"the",
"image",
"."
] | c96b010c02f15e8eeb0f71308c641179ac1f19bb | https://github.com/ageitgey/face_recognition/blob/c96b010c02f15e8eeb0f71308c641179ac1f19bb/face_recognition/api.py#L203-L213 | train | Given an image returns the 128 - dimensional face encoding for each face in the image. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apache/spark | python/pyspark/sql/types.py | _parse_datatype_string | def _parse_datatype_string(s):
"""
Parses the given data type string to a :class:`DataType`. The data type string format equals
to :class:`DataType.simpleString`, except that top level struct type can omit
the ``struct<>`` and atomic types use ``typeName()`` as their format, e.g. use ``byte`` instead
... | python | def _parse_datatype_string(s):
"""
Parses the given data type string to a :class:`DataType`. The data type string format equals
to :class:`DataType.simpleString`, except that top level struct type can omit
the ``struct<>`` and atomic types use ``typeName()`` as their format, e.g. use ``byte`` instead
... | [
"def",
"_parse_datatype_string",
"(",
"s",
")",
":",
"sc",
"=",
"SparkContext",
".",
"_active_spark_context",
"def",
"from_ddl_schema",
"(",
"type_str",
")",
":",
"return",
"_parse_datatype_json_string",
"(",
"sc",
".",
"_jvm",
".",
"org",
".",
"apache",
".",
... | Parses the given data type string to a :class:`DataType`. The data type string format equals
to :class:`DataType.simpleString`, except that top level struct type can omit
the ``struct<>`` and atomic types use ``typeName()`` as their format, e.g. use ``byte`` instead
of ``tinyint`` for :class:`ByteType`. We ... | [
"Parses",
"the",
"given",
"data",
"type",
"string",
"to",
"a",
":",
"class",
":",
"DataType",
".",
"The",
"data",
"type",
"string",
"format",
"equals",
"to",
":",
"class",
":",
"DataType",
".",
"simpleString",
"except",
"that",
"top",
"level",
"struct",
... | 618d6bff71073c8c93501ab7392c3cc579730f0b | https://github.com/apache/spark/blob/618d6bff71073c8c93501ab7392c3cc579730f0b/python/pyspark/sql/types.py#L758-L820 | train | Parses a string into a base - level structure type. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 35