{"info":{"_postman_id":"a9d75bbd-81e5-44a7-acae-2474178caa2b","name":"Face Recognition System","description":"<html><head></head><body><h1 id=\"introduction\">Introduction</h1>\n<p>This API runs face recognition algorithm on given image, create report for work hours of person or company on given database</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Introduction","slug":"introduction"}],"owner":"12485464","collectionId":"a9d75bbd-81e5-44a7-acae-2474178caa2b","publishedId":"TVCb3V9g","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-08-27T13:52:22.000Z"},"item":[{"name":"http://127.0.0.1:5000/api/v1/add","id":"83aacf4d-ba33-4637-b075-54d65baa7c5d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":""},"url":"http://127.0.0.1:5000/api/v1/add","description":"<p>Add a person to face recognition system</p>\n<p>Python Usage:</p>\n<p>url = 'webserver/api/v1/add'</p>\n<p>files = [('image', open(\"image1path.jpg\", 'rb')), ('image', open(\"image2path.jpg\", 'rb'))]</p>\n<p>r = requests.post(url, files=files)</p>\n<p>example response: r.text = {Success: x photo added} </p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","v1","add"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"5dcd1efb-6303-4052-bf51-98d34783a7c5","name":"Default","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":""},"url":"http://127.0.0.1:5000/api/v1/add"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":""}],"_postman_id":"83aacf4d-ba33-4637-b075-54d65baa7c5d"},{"name":"http://127.0.0.1:5000/api/v1/recognize","id":"4eaf3aa6-006b-45e7-93a2-3c02744e83bd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":""},"url":"http://127.0.0.1:5000/api/v1/recognize","description":"<p>Run face recognition on given image</p>\n<p>Python Usage:</p>\n<p>url = 'webserver/api/v1/recognize'</p>\n<p>files = [('image', open(\"image1path.jpg\", 'rb'))]</p>\n<p>r = requests.post(url, files=files)</p>\n<p>example response: r.text = {[\n  {\n    \"distance_score\": 0.26565412, \n    \"matched_name\": \"Ali_Koc\"\n  }\n]} </p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","v1","recognize"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"ecfef290-4257-4ec1-944e-d12933500522","name":"Default","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":""},"url":"http://127.0.0.1:5000/api/v1/recognize"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":""}],"_postman_id":"4eaf3aa6-006b-45e7-93a2-3c02744e83bd"},{"name":"http://127.0.0.1:5000/api/v1/get_report","id":"e8866bc9-35d4-49e0-b72d-fe35aaf0b8e7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"Abdullah","type":"text"},{"key":"report_type","value":"individual","type":"text"},{"key":"period","value":"year","type":"text"},{"key":"week","value":"1","type":"text"},{"key":"month","value":"1","type":"text"},{"key":"year","value":"2020","type":"text"}]},"url":"http://127.0.0.1:5000/api/v1/get_report","description":"<p>Get an byte array for report of the image</p>\n<p>Important: get_report returns bytes for the image of the report so, it should be converted correctly to use</p>\n<p>expected_arguments = [\"name\", \"report_type\", \"period\", \"week\", \"month\", \"year\"]</p>\n<p>\"name\": Name of the person to be reported</p>\n<p>There are 2 types of report for usage.</p>\n<p>report_type: \"individual\" or \"all\";</p>\n<p>\"individual\" creates personal report for given name at the parameters \"name\"</p>\n<p>\"all\" creates general report for all persons at the database</p>\n<p>There are 3 options of period for usage.</p>\n<p>\"week\", \"month\" and \"year\";</p>\n<p>\"week\": Creates weekly report</p>\n<p>\"month\": Creates monthly report</p>\n<p>\"year\": Creates yearly report</p>\n<p>The other parameters at the argument list \"week\", \"month\" and \"year\" are just used to indicate the date.</p>\n<p>Python Usage:</p>\n<p>url = 'webserver/api/v1/get_report'</p>\n<p>data = {\"name\": \"Abdullah\", \"report_type\": \"individual\", \"period\": \"year\", \"week\": \"1\", \"month\": \"1\", \"year\": \"2020\"}</p>\n<p>r = requests.post(url, data=data)</p>\n<ul>\n<li>The response is binary array for image of the report,</li>\n<li>in order to see the image:</li>\n</ul>\n<p>from PIL import Image</p>\n<p>from io import BytesIO</p>\n<p>stream = BytesIO(x.content)</p>\n<p>image = Image.open(stream).convert(\"RGBA\")</p>\n<p>stream.close()</p>\n<p>image.show()</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","v1","get_report"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"e8866bc9-35d4-49e0-b72d-fe35aaf0b8e7"}]}