Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9873831

Browse files
committed
2 parentsa98e85d +599c11b commit9873831

File tree

1 file changed

+352
-0
lines changed

1 file changed

+352
-0
lines changed

‎README.md‎

Lines changed: 352 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,352 @@
1+
2+
3+
4+
5+
<!-- PROJECT LOGO-->
6+
7+
<br />
8+
9+
<divalign="center"><ahref="#top"></a>
10+
11+
<imgsrc="landing/static/landing/img/face2.png"alt="Logo"width="80"height="80">
12+
13+
14+
15+
<h2align="center">FACE FIND</h2>
16+
17+
<h3align="center">Submission for Microsoft Engage 2022</h3>
18+
19+
<palign="center">
20+
21+
A Django web application to help find missing people using face recognition.
22+
23+
<br />
24+
25+
26+
27+
28+
[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/tinycoder2/msengage?logo=github&style=for-the-badge)](https://github.com/tinycoder2/msengage)
29+
[![GitHub last commit](https://img.shields.io/github/last-commit/tinycoder2/msengage?style=for-the-badge&logo=git)](https://github.com/tinycoder2/msengage)
30+
[![Languages](https://img.shields.io/github/languages/count/tinycoder2/msengage?style=for-the-badge)](https://github.com/tinycoder2/msengage)
31+
[![Generic badge](https://img.shields.io/badge/view-demo-blue?style=for-the-badge&label=View%20Demo%20Video)](https://youtu.be/onXOQIu5jCg)
32+
33+
<br />
34+
35+
</div>
36+
37+
38+
39+
<!-- TABLE OF CONTENTS-->
40+
<details>
41+
<summary>Table of Contents</summary>
42+
<ol>
43+
<li><ahref="#about-the-project">About The Project</a>
44+
<ul>
45+
<li><ahref="#built-with">Built With</a></li>
46+
</ul>
47+
</li>
48+
<li>
49+
<ahref="#getting-started">Getting Started</a>
50+
<ul>
51+
<li><ahref="#prerequisites">Prerequisites</a></li>
52+
<li><ahref="#getting-api-credentials">Getting API credentials</a></li>
53+
<li><ahref="#setup">Setup</a></li>
54+
</ul>
55+
</li>
56+
<li><ahref="#business-logic">Business Logic</a></li>
57+
<li><ahref="#tech-architecture">Tech Architecture</a></li>
58+
<li><ahref="#features-and-interfaces">Features and Interfaces</a></li>
59+
<li><ahref="#discussions">Discussions</a></li>
60+
<li><ahref="#lessons-learnt">Lessons Learnt</a></li>
61+
<li><ahref="#future-work">Future Work</a></li>
62+
</ol>
63+
</details>
64+
65+
66+
<!-- ABOUT THE PROJECT-->
67+
##About The Project
68+
The thought of a family member, a friend or someone else you care about going missing can be terrifying. This project aims to help find your loved ones using Face Recognition Technology. If someone you know is missing, then,
69+
- Register the missing person with us.
70+
- Once the background check is done and the missing person is verified, we generate a unique Face ID for the missing person using Azure's Face API.
71+
- When volunteers report a suspected missing person, we verify and generate a Face ID the same way. We then use Azure's Find Similar API to identify a potential match with our database of missing person Face IDs.
72+
- If a match is found we will contact you.
73+
<palign="right">(<ahref="#top">back to top</a>)</p>
74+
75+
###Built With
76+
To achieve our goal of finding missing people, we make use of the following tools and languages,
77+
<palign="left">
78+
<ahref="https://getbootstrap.com"target="_blank"><imgsrc="https://raw.githubusercontent.com/devicons/devicon/master/icons/bootstrap/bootstrap-plain-wordmark.svg"alt="bootstrap"width="40"height="40"/> </a>
79+
<ahref="https://www.w3schools.com/css/"target="_blank"> <imgsrc="https://raw.githubusercontent.com/devicons/devicon/master/icons/css3/css3-original-wordmark.svg"alt="css3"width="40"height="40"/> </a>
80+
<ahref="https://developer.mozilla.org/en-US/docs/Web/JavaScript"target="_blank"> <imgsrc="https://raw.githubusercontent.com/devicons/devicon/master/icons/javascript/javascript-original.svg"alt="javascript"width="40"height="40"/> </a>
81+
<ahref="https://www.w3.org/html/"target="_blank"> <imgsrc="https://raw.githubusercontent.com/devicons/devicon/master/icons/html5/html5-original-wordmark.svg"alt="html5"width="40"height="40"/> </a>
82+
<ahref="https://www.python.org/"target="_blank"> <imgsrc="https://raw.githubusercontent.com/devicons/devicon/master/icons/python/python-original-wordmark.svg"alt="express"width="40"height="40"/> </a>
83+
<ahref="https://www.djangoproject.com/"target="_blank"> <imgsrc="https://raw.githubusercontent.com/devicons/devicon/master/icons/django/django-plain.svg"alt="express"width="40"height="40"/> </a>
84+
<ahref="https://docs.microsoft.com/en-us/azure/cognitive-services/face/"target="_blank"> <imgsrc="https://raw.githubusercontent.com/devicons/devicon/master/icons/azure/azure-original.svg"alt="express"width="40"height="40"/> </a>
85+
<ahref="https://www.sqlite.org/index.html"target="_blank"> <imgsrc="https://raw.githubusercontent.com/devicons/devicon/master/icons/sqlite/sqlite-original.svg"alt="express"width="40"height="40"/> </a>
86+
<ahref="https://git-scm.com/"target="_blank"> <imgsrc="https://www.vectorlogo.zone/logos/git-scm/git-scm-icon.svg"alt="git"width="40"height="40"/> </a>
87+
<ahref="https://heroku.com"target="_blank"> <imgsrc="https://www.vectorlogo.zone/logos/heroku/heroku-icon.svg"alt="heroku"width="40"height="40"/> </a>
88+
<palign="right">(<ahref="#top">back to top</a>)</p>
89+
90+
<!-- GETTING STARTED-->
91+
##Getting Started
92+
###Prerequisites
93+
Firstly you have to make sure you have python installed. If you don't have python, you can get it[here](https://www.python.org/downloads/).
94+
* Use this command to check if python is installed,
95+
```sh
96+
python --version
97+
```
98+
###Getting API credentials
99+
To access Azure Cognitive Services REST API for Face Analysis, you will need,
100+
- An Azure account (you can create your account for free[here](https://azure.microsoft.com/en-au/free/))
101+
- A Computer Vision Resource in your Azure account
102+
103+
To create a Computer Vision Resource, you can navigate through the portal, create a new resource and go under the class of “AI+Machine Learning”. Then select the Face Cognitive Service and set the required information.
104+
105+
Under the Resource Management tab you will find “Keys and Endpoint”. From this section, copy one of the two Keys and the Endpoint and paste it somewhere safe. We will be using these in the`config.json` file.
106+
107+
For detailed instructions click[here.](https://medium.com/microsoftazure/azure-cognitive-services-rest-api-for-computer-vision-cf782e975837)
108+
109+
###Setup
110+
111+
_To get a local copy of the project and run it, follow these steps._
112+
113+
1. Create a folder in which you want set up the project. Go into that folder and check if python is installed.
114+
115+
```sh
116+
mkdir myFolder
117+
cd myFolder
118+
python --version
119+
120+
```
121+
122+
2. Clone the repository:
123+
124+
```sh
125+
126+
git clone https://github.com/tinycoder2/FaceFind.git
127+
128+
```
129+
130+
3. Create a virtual environment to install dependencies in and activate it:
131+
132+
```sh
133+
134+
python -m venv myEnv
135+
136+
cd myEnv
137+
138+
.\Scripts\activate
139+
140+
cd ..
141+
142+
```
143+
144+
4. Then install the dependencies:
145+
146+
```sh
147+
148+
cd FaceFind
149+
150+
pip install -r requirements.txt
151+
152+
```
153+
154+
155+
156+
5. Enter your API KEY, ENDPOINT that we got from <ahref="#credentials">Getting API credentials</a>, EMAIL ID and EMAIL PASSWORD in`config.json`
157+
158+
```json
159+
160+
{
161+
162+
"KEY":"Your Azure API KEY",
163+
164+
"ENDPOINT":"Your Azure Endpoint",
165+
166+
"EMAIL-ID":"Your Email ID from which the app will contact is missing person is found",
167+
168+
"EMAIL-PASSWORD":"Password for said Email ID"
169+
170+
}
171+
172+
```
173+
174+
To allow the app access your email account, go to[google account setting](https://myaccount.google.com/intro/security?hl=en) , security tab and ensure that you have*Less secure app access* turned*on.*
175+
176+
6. Apply migrations:
177+
178+
```sh
179+
180+
python manage.py migrate
181+
182+
```
183+
184+
7. Create admin account :
185+
186+
```sh
187+
188+
python manage.py createsuperuser
189+
190+
```
191+
192+
Follow the promt and enter the username, preferably*"admin"*, desired email and password. Make note of the username and password as you will have to use these credentials to login.
193+
194+
8. Run server:
195+
196+
```sh
197+
198+
python manage.py runserver
199+
200+
```
201+
202+
The app is now running at`http://127.0.0.1:8000/`
203+
204+
<palign="right">(<ahref="#top">back to top</a>)</p>
205+
206+
207+
208+
209+
210+
<!-- ARCHITECTURE DIAGRAMS-->
211+
212+
##Business Logic
213+
214+
<imgsrc="screenshots/diagrams/business_architecture.png"alt="businessArchitecture" >
215+
216+
<palign="right">(<ahref="#top">back to top</a>)</p>
217+
218+
219+
220+
<!-- ARCHITECTURE DIAGRAMS-->
221+
222+
##Tech Architecture
223+
224+
<imgsrc="screenshots/diagrams/tech_architecture.png"alt="techArchitecture">
225+
226+
<palign="right">(<ahref="#top">back to top</a>)</p>
227+
228+
229+
230+
<!-- Features and Interfaces-->
231+
232+
##Features and Interfaces
233+
###Home Screen
234+
- Landing page displaying hero section, about section, technology used and FAQ section.
235+
236+
###Registering a Missing Person
237+
238+
###Reporting a Suspected Missing Person
239+
240+
###Admin Login and Views
241+
- Logging in as the admin and displaying site from admin POV.
242+
243+
###Missing People Views
244+
- Viewing all missing people, ones that need to be approved, approving a missing person (background check), viewing missing people with status as Leads, status as Found, Deleting a missing person, Editing the details of a missing person.
245+
246+
###Reported Person Views
247+
- Viewing all reported people, ones that need to be approved, approving a reported person (checking validity of report), viewing details of potential match, confirming the match, status of missing person changing from Leads to Found.
248+
249+
###Email Received
250+
<imgsrc="screenshots/email_received.png"alt="emailReceived">
251+
252+
253+
254+
<palign="right">(<ahref="#top">back to top</a>)</p>
255+
256+
257+
258+
<!-- DISCUSSIONS-->
259+
260+
##Discussions
261+
262+
- Face Detection
263+
264+
- To detect the face in the image the person uploads, we use the[Detect With Stream API](https://docs.microsoft.com/en-us/rest/api/faceapi/face/detect-with-stream).
265+
266+
- In`people\views.py` we have a function`generate_face_id` that uses the Detect With Stream API to get the faceID, which is an identifier of the face feature and will be used in[Face - Find Similar](https://docs.microsoft.com/en-us/rest/api/faceapi/face/findsimilar).
267+
268+
```py
269+
270+
# function to generate face_id using Azure Face API
271+
272+
defgenerate_face_id(image_path):
273+
274+
face_client= FaceClient(config['ENDPOINT'], CognitiveServicesCredentials(config['KEY']))
275+
276+
response_detected_face= face_client.face.detect_with_stream(
277+
278+
image=open(image_path,'rb'),
279+
280+
detection_model='detection_03',
281+
282+
recognition_model='recognition_04',
283+
284+
)
285+
286+
return response_detected_face
287+
288+
```
289+
290+
- Face Recognition
291+
292+
- Given query face's faceID, to search the similar-looking faces from a`faceID array`, which is an array of faceIDs generated from[Detect With Stream API](https://docs.microsoft.com/en-us/rest/api/faceapi/face/detect-with-stream), we use the[Face - Find Similar API](https://docs.microsoft.com/en-us/rest/api/faceapi/face/findsimilar).
293+
294+
- In`people\views.py` we have a function`find_match` that uses this API to find a match for the reported person from the list of missing people faceIDs.
295+
296+
```py
297+
298+
# function to find a match for the reported person from the list of missing people using Azure Face API
299+
300+
deffind_match(reported_face_id,missing_face_ids):
301+
302+
face_client= FaceClient(config['ENDPOINT'], CognitiveServicesCredentials(config['KEY']))
303+
304+
matched_faces= face_client.face.find_similar(
305+
306+
face_id=reported_face_id,
307+
308+
face_ids=missing_face_ids
309+
310+
)
311+
312+
return matched_faces
313+
314+
```
315+
316+
- Given the timeframe for this project and the fact that I was using a free account with limited number of API calls, I have built my**MVP** with these two APIs.
317+
318+
- In the future I plan to make use of a`faceListId` instead of the`faceID array` for the[Face - Find Similar API](https://docs.microsoft.com/en-us/rest/api/faceapi/face/findsimilar).
319+
320+
- The major difference between these two is that`faceID array` contains the faces created by[Face - Detect With Url](https://docs.microsoft.com/en-us/rest/api/faceapi/face/detectwithurl) or[Face - Detect With Stream](https://docs.microsoft.com/en-us/rest/api/faceapi/face/detectwithstream), which will expire at the time specified by faceIdTimeToLive after creation, which is about 86400 seconds (24 hours) by default. A`faceListId` is created by[FaceList - Create](https://docs.microsoft.com/en-us/rest/api/faceapi/facelist/create) containing persistedFaceIds that will not expire.
321+
322+
- Furthermore, one could also use[PersonGroup](https://docs.microsoft.com/en-us/rest/api/faceapi/persongroup) /[LargePersonGroup](https://docs.microsoft.com/en-us/rest/api/faceapi/largepersongroup) and[Face - Identify](https://docs.microsoft.com/en-us/rest/api/faceapi/face/identify) when the face number is large, the[LargeFaceList](https://docs.microsoft.com/en-us/rest/api/faceapi/largefacelist) can support up to 1,000,000 faces.
323+
324+
325+
<palign="right">(<ahref="#top">back to top</a>)</p>
326+
327+
<!--LESSONS LEARNT-->
328+
##Lessons Learnt
329+
330+
<imgsrc="screenshots/diagrams/lessons_learnt.png"alt="lessonsLearnt" >
331+
332+
<palign="right">(<ahref="#top">back to top</a>)</p>
333+
334+
<!--FUTURE WORK-->
335+
336+
##Future Work
337+
338+
- Future plans include,
339+
340+
- SMS verification for registering a missing person
341+
342+
- Geo location from IP address while reporting suspected missing person.
343+
344+
- Using Azure's[PersonGroup](https://docs.microsoft.com/en-us/rest/api/faceapi/persongroup) /[LargePersonGroup](https://docs.microsoft.com/en-us/rest/api/faceapi/largepersongroup) and[Face - Identify](https://docs.microsoft.com/en-us/rest/api/faceapi/face/identify) for face detection and identification.
345+
346+
- Sanitizing traffic to prevent API throttling.
347+
348+
<palign="right">(<ahref="#top">back to top</a>)</p>
349+
350+
351+
352+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp