Code Monkey home page Code Monkey logo

finding-missing-person-using-ai's Introduction

Find Missing Person using AI

Issues Stars

Hundreds of people (especially children go missing every day) in India. There are various NGO's and Govt Initiatives to help with it. This project tries to implement an existing/new way to help.

List of contents

News Articles

News Article 1

News Article 2

What is the objective of this Project and how will it help?

The objective of this project is to help Police and higher authorities to track down missing people quickly. The usual process to track a person is using investigation which requires time and experience (to ask right questions). Most of the time, investigation method works pretty well but it is time consuming and can be unsuccessful if the person (missing) has been shifted/moved to different location (city/country).
In such cases, the ideal approach is to go through CCTV footages and evidences. Again, this can be very time consuming and given the number of people that go missing everyday, it can be a challanage to keep up with it.

Solution (Project's Implementation)

1. Registering New Cases

The first step is to register a new case. The GUI application is built using PyQT5 that allows you to collect all relevant information and store it in database Postgres.

Please ignore the SRK's image. It is just for the sake of project :)

New Case Window

2. Waiting for Users to submit images

So far we have only talked about 'how new cases will be registered', the next thing we have to do is to match these registered cases but who do we match it with? This is where ours Users come in. These users are common people like you and me who wants to make a change in the society.
The common people will use an application on their mobile to submit photos of people who they think have lost or found begging while keeping them their identity anonymous. The anonymous part is very important because they fear of local Gundas that might create trouble for them.

Mobile Application Mobile Application

An android Application can also be build and used but I have very little experience in it.

3. Matching Cases

The next step is to match the case images and user submitted images. To match KNN Algorithm is used. Main Application

How to run

1. With Docker (Easy)

Prerequisites

Docker (docker-compose as well)
$ git clone https://github.com/gaganmanku96/Finding-missing-person-using-AI
$ cd Finding-missing-person-using-AI
$ docker-compose up --build
$ cd app
$ pip install -r requirements.txt --no-cache-dir
$ python login_window.py

At this point you'll see a window like this Login Window

Default username: admin Default password: admin

Login window makes sure that only authenticated can view the registered cases. Each user can only view the cases submitted by him. NOTE: There is no concpet of superuser.

After logging in you'll see the main screen through which you'll be able to submit cases.

To run the mobile application:
$ cd mobile_app

or (if you are inside app dir)

$ ../mobile_app
$ python ui.py

After that you'll see a window like this
mobile application

You can this to submit user images or you can create your own mobile app.

Once done you'll have to Click on Refresh button on train KNN Model and then on Match to start Matching Images.

2. Without Docker (Intermediate)

Here are the step you have to do

  1. Install Postgres Database and replace the username and password in config/.env.file
  2. The next step is to run database and make sure it is working.
$ cd database
$ pip install -r requirements.txt
$ uvicorn main:app --port 8002
  1. Next, the face encoding api
$ cd face_encoding
$ pip install -r requirements.txt
$ uvicorn main:app --port 8000

If you are using non-conda environment like venv then it might give error while installing dlib library.

  1. Running the application
$ cd app
$ pip install -r requirements.txt
$ python login.py

At this point you'll see a window like this Login Window

Default username: admin Default password: admin

Login window makes sure that only authenticated can view the registered cases. Each user can only view the cases submitted by him. NOTE: There is no concpet of superuser.

After logging in you'll see the main screen through which you'll be able to submit cases.

To run the mobile application:
$ cd mobile_app

or (if you are inside app dir)

$ ../mobile_app
$ python ui.py

After that you'll see a window like this
mobile application

You can this to submit user images or you can create your own mobile app.

Once done you'll have to Click on Refresh button on train KNN Model and then on Match to start Matching Images.

What is left?

  • Login (Authentication)
  • Submit new case
  • Mobile Application (to submit user photos)
  • View submitted cases
  • View confirmed cases
  • Unit tests

Developer:

Endorse me at LinkedIn if this project was helpful. Linkedin LinkedIn

Vote of Thanks

  • Thanks to Davis King for creating dlib and for providing the trained facial feature detection and face encoding models used in this project.

finding-missing-person-using-ai's People

Contributors

deepsourcebot avatar gagandeepsingh09 avatar gaganmanku96 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

finding-missing-person-using-ai's Issues

Database issue

db_api.py file which was showed in your youtube video is not attached in github source code... Plz attach this file or send me the file. Plz sir.

database Issue

  • database is not running issue how to solve this issue

help

hey um is the project fully completed? I wanna try and implement it.

keyError:'status'

when i try running it and enter username and password it gives this error

Traceback (most recent call last):
File "login_window.py", line 67, in login
if login_status['status'] == True:
KeyError: 'status'

Target Refused to Connect

HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: //login?username=admin&password=admin (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000020B19BE3DC0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

Error

I have an error when I am installing lib firebase_admin using pip install firebase_admin.
IMG_20200428_143548

result error

when we match a case instead of showing only matched case it is displaying total database

Couldn't find face in image

This error occurs every time I upload a facial image to register a new case.

While using docker, the image can be uploaded but is not able to save the case. Something went wrong error comes up.

can u plz help me ?

actully i want to detect missing person through cctv. how is going to work. plz help

docker issue

when i run : uvicorn main:app --port 8000 this line
it shows
localhost
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\sri19\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts\uvicorn.exe_main
.py", line 7, in
File "C:\Users\sri19\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\click\core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sri19\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "C:\Users\sri19\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sri19\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sri19\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\uvicorn\main.py", line 409, in main
run(
File "C:\Users\sri19\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\uvicorn\main.py", line 575, in run
server.run()
File "C:\Users\sri19\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\uvicorn\server.py", line 62, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2288.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2288.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 118, in run
return self.loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2288.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\sri19\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\uvicorn\server.py", line 69, in serve
config.load()
File "C:\Users\sri19\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\uvicorn\config.py", line 433, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sri19\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\uvicorn\importer.py", line 19, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2288.0_x64__qbz5n2kfra8p0\Lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in call_with_frames_removed
File "E:\Finding-missing-person-using-AI-master\database\main.py", line 11, in
create()
File "E:\Finding-missing-person-using-AI-master\database\create_tables.py", line 13, in create
with PostgresConnection() as conn:
File "E:\Finding-missing-person-using-AI-master\database\postgres.py", line 32, in enter
raise e
File "E:\Finding-missing-person-using-AI-master\database\postgres.py", line 22, in enter
self.connection = psycopg2.connect(
^^^^^^^^^^^^^^^^^
File "C:\Users\sri19\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\psycopg2_init
.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused (0x0000274D/10061)
Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused (0x0000274D/10061)
Is the server running on that host and accepting TCP/IP connections?

incompatibility issues

while installing libraries (pip install -r requirements.txt) I got these errors
ERROR: thinc 8.0.1 has requirement pydantic<1.8.0,>=1.7.1, but you'll have pydantic 1.8.2 which is incompatible.
ERROR: spacy 3.0.1 has requirement pydantic<1.8.0,>=1.7.1, but you'll have pydantic 1.8.2 which is incompatible.
ERROR: en-core-web-sm 2.3.1 has requirement spacy<2.4.0,>=2.3.0, but you'll have spacy 3.0.1 which is incompatible.
how to resolve these errors?

database_api exited with code 1

database_api     | "database_pg"
database_api     | Traceback (most recent call last):
database_api     |   File "/usr/local/bin/uvicorn", line 8, in <module>
database_api     |     sys.exit(main())
database_api     |   File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
database_api     |     return self.main(*args, **kwargs)
database_api     |   File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
database_api     |     rv = self.invoke(ctx)
database_api     |   File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
database_api     |     return ctx.invoke(self.callback, **ctx.params)
database_api     |   File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
database_api     |     return callback(*args, **kwargs)
database_api     |   File "/usr/local/lib/python3.8/site-packages/uvicorn/main.py", line 357, in main
database_api     |     run(**kwargs)
database_api     |   File "/usr/local/lib/python3.8/site-packages/uvicorn/main.py", line 381, in run
database_api     |     server.run()
database_api     |   File "/usr/local/lib/python3.8/site-packages/uvicorn/_impl/asyncio.py", line 47, in run
database_api     |     loop.run_until_complete(self.serve(sockets=sockets))
database_api     |   File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
database_api     |     return future.result()
database_api     |   File "/usr/local/lib/python3.8/site-packages/uvicorn/_impl/asyncio.py", line 54, in serve
database_api     |     config.load()
database_api     |   File "/usr/local/lib/python3.8/site-packages/uvicorn/config.py", line 306, in load
database_api     |     self.loaded_app = import_from_string(self.app)
database_api     |   File "/usr/local/lib/python3.8/site-packages/uvicorn/importer.py", line 20, in import_from_string
database_api     |     module = importlib.import_module(module_str)
database_api     |   File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
database_api     |     return _bootstrap._gcd_import(name[level:], package, level)
database_api     |   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
database_api     |   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
database_api     |   File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
database_api     |   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
database_api     |   File "<frozen importlib._bootstrap_external>", line 783, in exec_module
database_api     |   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
database_api     |   File "./main.py", line 12, in <module>
database_api     |     create()
database_api     |   File "./create_tables.py", line 10, in create
database_api     |     with PostgresConnection() as conn:
database_api     |   File "./postgres.py", line 32, in __enter__
database_api     |     raise e
database_api     |   File "./postgres.py", line 22, in __enter__
database_api     |     self.connection = psycopg2.connect(
database_api     |   File "/usr/local/lib/python3.8/site-packages/psycopg2/__init__.py", line 127, in connect
database_api     |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
database_api     | psycopg2.OperationalError: could not translate host name ""database_pg"" to address: Name or service not known
database_api     | 
database_api exited with code 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.