├── .gitignore ├── README.md └── app ├── app.py ├── createTables.py ├── db.py ├── main.py ├── requirements.txt ├── static ├── css │ ├── case.css │ ├── feedback.css │ ├── policehome.css │ ├── results.css │ ├── style.css │ ├── style1.css │ ├── style2.css │ ├── stylecs │ └── stylecs.css ├── img │ ├── bgvdo.mp4 │ └── police.png ├── screenshots │ ├── Neeraj Ram1.jpg │ ├── Neeraj1.jpg │ ├── Nidhin1.jpg │ ├── Ronaldo1.jpg │ └── dq1.jpg └── uploads │ ├── 1329279.jpg │ ├── Ashwin_Photo.jpg │ ├── IMG20220519200733.jpg │ ├── IMG_17965.jpg │ ├── IMG_20201121_011127_564.jpg │ ├── Mohanlal1.jpg │ ├── Neeraj.gif │ ├── Neeraj.jpg │ ├── Neeraj2.jpg │ ├── Photo-1.jpeg │ ├── Renjith_R.jpg │ ├── Resus.png │ ├── WhatsApp_Image_2022-05-26_at_10.05.01_AM.jpeg │ ├── WhatsApp_Image_2022-05-26_at_10.05.03_AM1.jpeg │ ├── cr7.jpg │ ├── dq2.jpg │ ├── hrithik.jpg │ ├── icons8-nfc-n-16.png │ ├── icons8-react-100.png │ ├── messi.jpg │ └── messi2.jpg └── templates ├── admin.html ├── adminhome.html ├── index.html ├── login.html ├── newcase.html ├── policehome.html ├── register.html ├── result.html ├── results.html ├── user.html └── useruploads.html /.gitignore: -------------------------------------------------------------------------------- 1 | **/__pycache__/ 2 | 3 | .env -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # **GOD,S EYE** 2 | 5 | 6 | 7 | 8 | 16 | ## **Prerequisite** 17 | 1) Python3 18 | 2) Dlib 19 | 3) Postgressql RDMS 20 | 4) Pgadmin4 (not mandatory) 21 | 22 | ## **Installation** 23 | 24 | Clone this respositor using the command 25 | 26 | ```sh 27 | git clone https://github.com/neerajram30/God-s-Eye.git 28 | 29 | ``` 30 | 31 | Ubuntu: 32 | 33 | ```sh 34 | cat requirements.txt 35 | 36 | ``` 37 | From the requirements install all the libraries one by one or install all by 38 | 39 | ```sh 40 | pip install -r requirements.txt 41 | 42 | ``` 43 | 48 | ## **Configuration** 49 | 50 | Create .env in root directory and configure it to files. Replace the fields with your credentials 51 | 52 | ```sh 53 | DB_HOST = "YOUR HOST NAME" 54 | DB_NAME = "YOUR DB NAME" 55 | DB_USER = "YOUR DB USER NAME" 56 | DB_PASS = "YOUR DB PASSWORD" 57 | APP_SECRET = "APP PASSWORD" 58 | ``` 59 | 60 | 61 | ## **Usage example** 62 | 63 | For running this app on development environment you can uncomment this code 64 | 65 | ```py 66 | if __name__=='__main__': 67 | app.run(debug=True) 68 | ``` 69 | For running this app on production environment you can uncomment this code, the CCTV will only open when this option is enabled. 70 | 71 | ```py 72 | if __name__ == '__main__': 73 | app.run(host='0.0.0.0', port=2204, threaded=True) 74 | ``` 75 | For creating database tables run command: 76 | 77 | ```sh 78 | python3 createTables.py 79 | ``` 80 | 81 | 82 | For running this application on both product and development environment you can use this command 83 | ```sh 84 | python3 app.py 85 | ``` 86 | 87 | ### Built With 88 | 89 | * [Python](https://www.python.org/) 90 | * [Flask](https://flask.palletsprojects.com/en/2.1.x/) 91 | * [Postgress DB](https://www.postgresql.org/) 92 | * [VS code](https://code.visualstudio.com/) 93 | 94 | 95 | ### Libraries Used 96 | 97 | * [Face Recognition](https://face-recognition.readthedocs.io/en/latest/readme.html) 98 | * [Dlib](http://dlib.net/) 99 | * [OpenCV](https://opencv.org/) 100 | * [NumPy](https://numpy.org/) 101 | 102 | ## **Contact Us** 103 | 104 | 106 |
107 |
108 | 109 | [![Linkedin profile][Linkedin]][linkedin-url] 110 | 111 | 112 |
113 | 156 | 162 | 163 | [Linkedin]: https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white 164 | [linkedin-url]: https://www.linkedin.com/in/neeraj-m-r-173b64216/ 165 | -------------------------------------------------------------------------------- /app/app.py: -------------------------------------------------------------------------------- 1 | from crypt import methods 2 | from dotenv import load_dotenv 3 | import os 4 | import re 5 | from sre_constants import SUCCESS 6 | from cv2 import split 7 | from flask import Flask, render_template, Response, request, redirect, url_for, flash, session 8 | import urllib.request 9 | import cv2 10 | import face_recognition 11 | import numpy as np 12 | from face_recognition.face_recognition_cli import image_files_in_folder 13 | from werkzeug.utils import secure_filename 14 | import psycopg2 15 | import psycopg2.extras 16 | from datetime import date,datetime 17 | from werkzeug.security import generate_password_hash, check_password_hash 18 | from ipregistry import IpregistryClient 19 | import json 20 | from geopy.geocoders import Nominatim 21 | import ast 22 | from db import conn 23 | 24 | load_dotenv() 25 | # IP_REGISTRY_KEY = os.getenv('IP_REGISTRY_KEY') 26 | # resource = urllib.request.urlopen(IP_REGISTRY_KEY) 27 | # payload = resource.read().decode('utf-8') 28 | 29 | # geoLoc = Nominatim(user_agent="GetLoc") 30 | 31 | 32 | 33 | app = Flask(__name__) 34 | app.secret_key = os.getenv("APP_SECRET") 35 | 36 | # DB_HOST = os.getenv("DB_HOST") 37 | # DB_NAME = os.getenv("DB_NAME") 38 | # DB_USER = os.getenv("DB_USER") 39 | # DB_PASS = os.getenv("DB_PASS") 40 | 41 | # DB_HOST = "localhost" 42 | # DB_NAME = "final_project" 43 | # DB_USER = "postgres" 44 | # DB_PASS = "12345" 45 | 46 | UPLOAD_FOLDER = 'static/uploads/' 47 | app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER 48 | known_face_encodings = [] 49 | known_face_names = [] 50 | TOLERANCE = 0.6 51 | 52 | 53 | 54 | face_locations = [] 55 | face_encodings = [] 56 | face_names = [] 57 | process_this_frame = True 58 | 59 | 60 | 61 | screenshorts=[] 62 | locations =[] 63 | names =[] 64 | dates=[] 65 | # screenshort ="" 66 | # location ="" 67 | 68 | 69 | ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif']) 70 | if(conn): 71 | print("Database set up completed and connection established succesfully") 72 | 73 | 74 | def allowed_file(filename): 75 | return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS 76 | 77 | 78 | camera = cv2.VideoCapture(0) 79 | 80 | 81 | # def verifyImage(cases): 82 | # train_images = [] 83 | # known_face =[] 84 | # for i in cases: 85 | # train_images.append(i[5]) 86 | # known_face.append(i[1]) 87 | # face_locations = face_recognition.face_locations(rgb_small_frame) 88 | # face_encodings = face_recognition.face_encodings(rgb_small_frame) 89 | # print(face_encodings) 90 | # return train_images+known_face 91 | def Remove(duplicate): 92 | final_list = [] 93 | for num in duplicate: 94 | if num not in final_list: 95 | final_list.append(num) 96 | return final_list 97 | 98 | def gen_frames(): 99 | # latitude = json.loads(payload)['location']['latitude'] 100 | # longitude = json.loads(payload)['location']['longitude'] 101 | # la=str(latitude) 102 | # lo=str(longitude) 103 | # locname = geoLoc.reverse(la+','+lo) 104 | 105 | while True: 106 | success, frame = camera.read() 107 | 108 | if not success: 109 | break 110 | else: 111 | # Resize frame of video to 1/4 size for faster face recognition processing 112 | small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25) 113 | # Convert the image from BGR color (which OpenCV uses) to RGB color (which face_recognition uses) 114 | rgb_small_frame = small_frame[:, :, ::-1] 115 | 116 | # Only process every other frame of video to save time 117 | 118 | # Find all the faces and face encodings in the current frame of video 119 | face_locations = face_recognition.face_locations(rgb_small_frame) 120 | face_encodings = face_recognition.face_encodings( 121 | rgb_small_frame, face_locations) 122 | face_names = [] 123 | for face_encoding in face_encodings: 124 | # See if the face is a match for the known face(s) 125 | matches = face_recognition.compare_faces( 126 | known_face_encodings, face_encoding, TOLERANCE) 127 | name = "Unknown" 128 | # Or instead, use the known face with the smallest distance to the new face 129 | face_distances = face_recognition.face_distance( 130 | known_face_encodings, face_encoding) 131 | best_match_index = np.argmin(face_distances) 132 | path = 'static/screenshots/' 133 | if matches[best_match_index]: 134 | name = known_face_names[best_match_index] 135 | # num = 0 136 | # while num < 3: 137 | # cv2.imwrite(os.path.join( 138 | # path, name+str(num)+'.jpg'), frame) 139 | # screenshorts.append(name+str(num)+'.jpg') 140 | # # filename = secure_filename(name+str(num)+'.jpg'.filename) 141 | # # name+str(num)+'.jpg'.save(os.path.join(app.config['path'], filename)) 142 | # # screenshorts.append(name+str(num)+'.jpg') 143 | # num = num+1 144 | cv2.imwrite(os.path.join(path, name+str(1)+'.jpg'), frame) 145 | # locations.append(locname.address) 146 | screenshorts.append(name+str(1)+'.jpg') 147 | names.append(name) 148 | now=datetime.now() 149 | dt_str=now.strftime("%d/%m/%Y") 150 | dates.append(dt_str) 151 | face_names.append(name) 152 | 153 | # Display the results 154 | for (top, right, bottom, left), name in zip(face_locations, face_names): 155 | # Scale back up face locations since the frame we detected in was scaled to 1/4 size 156 | top *= 4 157 | right *= 4 158 | bottom *= 4 159 | left *= 4 160 | 161 | # Draw a box around the face 162 | cv2.rectangle(frame, (left, top), 163 | (right, bottom), (0, 0, 255), 2) 164 | 165 | # Draw a label with a name below the face 166 | cv2.rectangle(frame, (left, bottom - 35), 167 | (right, bottom), (0, 0, 255), cv2.FILLED) 168 | font = cv2.FONT_HERSHEY_DUPLEX 169 | cv2.putText(frame, name, (left + 6, bottom - 6), 170 | font, 1.0, (255, 255, 255), 1) 171 | 172 | ret, buffer = cv2.imencode('.jpg', frame) 173 | 174 | frame = buffer.tobytes() 175 | yield (b'--frame\r\n' 176 | b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n') 177 | 178 | camera.release() 179 | cv2.destroyAllWindows() 180 | 181 | 182 | @app.route('/') 183 | def index(): 184 | # if 'loggedin' in session: 185 | # return render_template('policehome.html') 186 | # scr = Remove(screenshorts) 187 | # print(scr) 188 | # loc =Remove(locations) 189 | # print(loc) 190 | # print(locations) 191 | 192 | return render_template('index.html') 193 | 194 | 195 | @app.route('/video_feed') 196 | def video_feed(): 197 | scr = Remove(screenshorts) 198 | loc =Remove(locations) 199 | name =Remove(names) 200 | date =Remove(dates) 201 | 202 | print("--------------------------",scr) 203 | print("--------------------------",loc) 204 | cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) 205 | cursor.execute("INSERT INTO spoted (image, location, name, date) VALUES (%s,%s,%s,%s)",(scr,loc,name,date)) 206 | conn.commit() 207 | return Response(gen_frames(), mimetype='multipart/x-mixed-replace; boundary=frame') 208 | 209 | 210 | @app.route('/newcase') 211 | def newcase(): 212 | if 'loggedin' in session: 213 | return render_template('newcase.html') 214 | return redirect('login') 215 | 216 | 217 | @app.route('/newcase', methods=['POST']) 218 | def casedetails(): 219 | 220 | cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) 221 | m_name = request.form['m_name'] 222 | mobile = request.form['mobile'] 223 | age = request.form['age'] 224 | m_date = date.today() 225 | file = request.files['file'] 226 | location = request.form['location'] 227 | 228 | if 'file' not in request.files: 229 | flash('No file part') 230 | return redirect(request.url) 231 | if file.filename == '': 232 | flash('No image selected for uploading') 233 | return redirect(request.url) 234 | if file and allowed_file(file.filename): 235 | filename = secure_filename(file.filename) 236 | file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename)) 237 | #print('upload_image filename: ' + filename) 238 | cursor.execute("INSERT INTO newcases (m_name,mobile,date,age,file,location) VALUES (%s,%s,%s,%s,%s,%s)", 239 | (m_name, mobile, m_date, age, filename, location,)) 240 | conn.commit() 241 | 242 | flash('Image successfully uploaded and displayed below') 243 | # return render_template('index.html', filename=filename) 244 | return redirect(url_for('policehome')) 245 | else: 246 | flash('Allowed image types are - png, jpg, jpeg, gif') 247 | return redirect(request.url) 248 | 249 | 250 | @app.route('/train', methods=['GET']) 251 | def train(): 252 | cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) 253 | cursor.execute("SELECT m_name, file FROM newcases") 254 | results = cursor.fetchall() 255 | 256 | for i in results: 257 | m_name = i[0] 258 | m_image = i[1] 259 | # print(m_name,m_image) 260 | image_directory = os.path.join(app.config['UPLOAD_FOLDER'], m_image) 261 | missing_image = face_recognition.load_image_file(image_directory) 262 | missing_face_encoding = face_recognition.face_encodings(missing_image)[0] 263 | 264 | known_face_encodings.append(missing_face_encoding) 265 | known_face_names.append(m_name) 266 | print("++++++++ Training done for "+m_name + 267 | " with image: "+m_image+" ++++++++") 268 | flash("Refresh completed.") 269 | return redirect(url_for('policehome')) 270 | 271 | 272 | @app.route('/login', methods=['GET', 'POST']) 273 | def login(): 274 | if 'loggedin' in session: 275 | return redirect(url_for('policehome')) 276 | cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) 277 | 278 | # Check if "username" and "password" POST requests exist (user submitted form) 279 | if request.method == 'POST' and 'police_id' in request.form and 'password' in request.form: 280 | police_id = request.form['police_id'] 281 | password = request.form['password'] 282 | 283 | # Check if account exists using MySQL 284 | cursor.execute( 285 | 'SELECT * FROM police WHERE police_id = %s', (police_id,)) 286 | # Fetch one record and return result 287 | account = cursor.fetchone() 288 | 289 | if account: 290 | password_rs = account['password'] 291 | # If account exists in users table in out database 292 | if check_password_hash(password_rs, password): 293 | # Create session data, we can access this data in other routes 294 | session['loggedin'] = True 295 | session['id'] = account['id'] 296 | session['police_id'] = account['police_id'] 297 | # Redirect to home page 298 | return redirect(url_for('policehome')) 299 | else: 300 | # Account doesnt exist or username/password incorrect 301 | flash('Incorrect username/password') 302 | else: 303 | # Account doesnt exist or username/password incorrect 304 | flash('Incorrect user credentials') 305 | 306 | return render_template('login.html') 307 | 308 | 309 | @app.route('/register', methods=['GET', 'POST']) 310 | def register(): 311 | if 'loggedin' in session: 312 | return redirect(url_for('policehome')) 313 | cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) 314 | 315 | # Check if "username", "password" and "email" POST requests exist (user submitted form) 316 | if request.method == 'POST' and 'police_id' in request.form and 'password' in request.form and 'mobile' in request.form: 317 | # Create variables for easy access 318 | police_id = request.form['police_id'] 319 | p_name = request.form['p_name'] 320 | station = request.form['station'] 321 | post = request.form['post'] 322 | mobile = request.form['mobile'] 323 | password = request.form['password'] 324 | 325 | _hashed_password = generate_password_hash(password) 326 | print(_hashed_password) 327 | # Check if account exists using MySQL 328 | cursor.execute( 329 | 'SELECT * FROM police WHERE police_id = %s', (police_id,)) 330 | account = cursor.fetchone() 331 | 332 | # If account exists show error and validation checks 333 | if account: 334 | flash('Account already exists!') 335 | # elif not re.match(r'[^@]+@[^@]+\.[^@]+', email): 336 | # flash('Invalid email address!') 337 | # elif not re.match(r'[A-Za-z0-9]+', username): 338 | # flash('Username must contain only characters and numbers!') 339 | # elif not username or not password or not email: 340 | # flash('Please fill out the form!') 341 | else: 342 | # Account doesnt exists and the form data is valid, now insert new account into users table 343 | try: 344 | 345 | cursor.execute("INSERT INTO police (police_id, p_name, station, post, mobile, password) VALUES (%s,%s,%s,%s,%s,%s)", 346 | (police_id, p_name, station, post, mobile, _hashed_password,)) 347 | conn.commit() 348 | flash('You have successfully registered!') 349 | return redirect(url_for('login')) 350 | except (Exception, psycopg2.DatabaseError) as error: 351 | print('error is --------------'+error) 352 | elif request.method == 'POST': 353 | # Form is empty... (no POST data) 354 | flash('Please fill out the form!') 355 | # Show registration form with message (if any) 356 | return render_template('register.html') 357 | 358 | 359 | @app.route('/logout') 360 | def logout(): 361 | # Remove session data, this will log the user out 362 | session.pop('loggedin', None) 363 | session.pop('p_id', None) 364 | session.pop('police_id', None) 365 | # Redirect to login page 366 | return redirect(url_for('login')) 367 | 368 | 369 | @app.route('/police_home') 370 | def policehome(): 371 | cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) 372 | 373 | cursor.execute("select * from newcases") 374 | data = cursor.fetchall() 375 | 376 | if 'loggedin' in session: 377 | return render_template('policehome.html', value=data) 378 | return redirect(url_for('login')) 379 | 380 | @app.route('/results') 381 | def results(): 382 | cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) 383 | cursor.execute("select * from spoted") 384 | data = cursor.fetchall() 385 | print("data= ",data) 386 | # for x in data: 387 | # img=x[1] 388 | # loc=x[2] 389 | # dictionary =eval(img) 390 | # dictionary1 =eval(loc) 391 | # print(dictionary1) 392 | # final_data =np.hstack((dictionary,dictionary1)) 393 | # f_d = Remove(final_data) 394 | 395 | # loc_data=json.loads(loc) 396 | 397 | return render_template('results.html', value=data) 398 | @app.route('/user') 399 | def userrend(): 400 | return render_template('user.html') 401 | 402 | 403 | 404 | @app.route('/user' ,methods=['POST','GET']) 405 | def user(): 406 | if request.method == 'POST': 407 | cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) 408 | u_name = request.form['u_name'] 409 | phone = request.form['phone'] 410 | location = request.form['location'] 411 | file = request.files['file'] 412 | if 'file' not in request.files: 413 | flash('No file part') 414 | return redirect(request.url) 415 | if file.filename == '': 416 | flash('No image selected for uploading') 417 | return redirect(request.url) 418 | if file and allowed_file(file.filename): 419 | filename = secure_filename(file.filename) 420 | file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename)) 421 | #print('upload_image filename: ' + filename) 422 | cursor.execute("INSERT INTO users (name,mobile,location,file) VALUES (%s,%s,%s,%s)", 423 | (u_name, phone, location, filename,)) 424 | conn.commit() 425 | 426 | flash('Image successfully uploaded and displayed below') 427 | # return render_template('index.html', filename=filename) 428 | return redirect(url_for('user')) 429 | 430 | @app.route('/userupload') 431 | def userupload(): 432 | cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) 433 | # cursor.execute("select * from newcases") 434 | # cases = cursor.fetchall() 435 | # match = verifyImage(cases) 436 | # print(match) 437 | cursor.execute("select * from users") 438 | data = cursor.fetchall() 439 | return render_template('useruploads.html', value=data) 440 | 441 | 442 | @app.route('/admin', methods=['POST','GET']) 443 | def admin(): 444 | if 'admin-loggedin' in session: 445 | return redirect(url_for('adminhome')) 446 | cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) 447 | 448 | # Check if "username" and "password" POST requests exist (user submitted form) 449 | if request.method == 'POST' and 'a_name' in request.form and 'password' in request.form: 450 | a_name = request.form['a_name'] 451 | password = request.form['password'] 452 | 453 | # Check if account exists using MySQL 454 | cursor.execute( 455 | 'SELECT * FROM admin WHERE a_name = %s', (a_name,)) 456 | # Fetch one record and return result 457 | account = cursor.fetchone() 458 | 459 | if account: 460 | password_rs = account['password'] 461 | # If account exists in users table in out database 462 | if (password_rs == password): 463 | # Create session data, we can access this data in other routes 464 | session['admin-loggedin'] = True 465 | session['a_name'] = account['a_name'] 466 | # Redirect to home page 467 | return redirect(url_for('adminhome')) 468 | else: 469 | # Account doesnt exist or username/password incorrect 470 | flash('Incorrect username/password') 471 | else: 472 | # Account doesnt exist or username/password incorrect 473 | flash('Incorrect user credentials') 474 | 475 | return render_template('admin.html') 476 | 477 | @app.route('/adminhome') 478 | def adminhome(): 479 | cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) 480 | 481 | cursor.execute("select * from newcases") 482 | data = cursor.fetchall() 483 | 484 | if 'admin-loggedin' in session: 485 | return render_template('adminhome.html', value=data) 486 | return redirect(url_for('admin')) 487 | 488 | @app.route('/adminlogout') 489 | def adminlogout(): 490 | # Remove session data, this will log the user out 491 | session.pop('admin-loggedin', None) 492 | session.pop('a_name', None) 493 | 494 | return redirect(url_for('admin')) 495 | 496 | # if __name__=='__main__': 497 | 498 | # app.run(debug=True) 499 | 500 | 501 | if __name__ == '__main__': 502 | app.run(host='0.0.0.0', port=2204, threaded=True) 503 | -------------------------------------------------------------------------------- /app/createTables.py: -------------------------------------------------------------------------------- 1 | from db import conn 2 | 3 | 4 | 5 | commands = ( 6 | """ 7 | CREATE TABLE newcases ( 8 | id SERIAL PRIMARY KEY, 9 | m_name VARCHAR(255) NOT NULL, 10 | mobile VARCHAR(10) NOT NULL, 11 | date VARCHAR(255) NOT NULL, 12 | age INTEGER NOT NULL, 13 | file VARCHAR(255) NOT NULL, 14 | location VARCHAR(255) NOT NULL); 15 | 16 | """ 17 | , 18 | """ 19 | CREATE TABLE police 20 | (id SERIAL PRIMARY KEY, 21 | police_id INTEGER NOT NULL, 22 | p_name VARCHAR(20) NOT NULL, 23 | station VARCHAR(20) NOT NULL, 24 | post VARCHAR(20) NOT NULL, 25 | mobile VARCHAR(10) NOT NULL, 26 | password VARCHAR(255) NOT NULL); 27 | 28 | """ 29 | , 30 | 31 | """ 32 | CREATE TABLE spoted 33 | (id SERIAL PRIMARY KEY, 34 | image VARCHAR(255) NOT NULL, 35 | location VARCHAR(255) NOT NULL, 36 | name VARCHAR(255) NOT NULL, 37 | date VARCHAR(255) NOT NULL); 38 | 39 | """ 40 | , 41 | 42 | """ 43 | CREATE TABLE users 44 | (id SERIAL PRIMARY KEY, 45 | name VARCHAR(255) NOT NULL, 46 | mobile VARCHAR(255) NOT NULL, 47 | location VARCHAR(255) NOT NULL, 48 | file VARCHAR(255) NOT NULL); 49 | 50 | """ 51 | 52 | ) 53 | cur = conn.cursor() 54 | # create table one by one 55 | for command in commands: 56 | cur.execute(command) 57 | 58 | 59 | conn.commit() 60 | print('Tables created succesfully') 61 | 62 | -------------------------------------------------------------------------------- /app/db.py: -------------------------------------------------------------------------------- 1 | import psycopg2 2 | import psycopg2.extras 3 | from dotenv import load_dotenv 4 | import os 5 | 6 | load_dotenv() 7 | 8 | DB_HOST = os.getenv("DB_HOST") 9 | DB_NAME = os.getenv("DB_NAME") 10 | DB_USER = os.getenv("DB_USER") 11 | DB_PASS = os.getenv("DB_PASS") 12 | 13 | conn = psycopg2.connect(dbname=DB_NAME, user=DB_USER, 14 | password=DB_PASS, host=DB_HOST) 15 | 16 | if(conn): 17 | print("Setting up database") -------------------------------------------------------------------------------- /app/main.py: -------------------------------------------------------------------------------- 1 | import face_recognition 2 | import cv2 3 | import numpy as np 4 | 5 | video_capture = cv2.VideoCapture(0) 6 | aswin_image = face_recognition.load_image_file("aswin/aswin.jpg") 7 | aswin_face_encoding = face_recognition.face_encodings(aswin_image)[0] 8 | known_face_encodings = [ 9 | aswin_face_encoding, 10 | ] 11 | known_face_names = [ 12 | "aswin", 13 | ] 14 | face_locations = [] 15 | face_encodings = [] 16 | face_names = [] 17 | process_this_frame = True 18 | while True: 19 | ret, frame = video_capture.read() 20 | small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25) 21 | rgb_small_frame = small_frame[:, :, ::-1] 22 | if process_this_frame: 23 | face_locations = face_recognition.face_locations(rgb_small_frame) 24 | face_encodings = face_recognition.face_encodings(rgb_small_frame, face_locations) 25 | face_names = [] 26 | for face_encoding in face_encodings: 27 | matches = face_recognition.compare_faces(known_face_encodings, face_encoding) 28 | name = "Unknown" 29 | face_distances = face_recognition.face_distance(known_face_encodings, face_encoding) 30 | best_match_index = np.argmin(face_distances) 31 | if matches[best_match_index]: 32 | name = known_face_names[best_match_index] 33 | face_names.append(name) 34 | process_this_frame = not process_this_frame 35 | for (top, right, bottom, left), name in zip(face_locations, face_names): 36 | top *= 4 37 | right *= 4 38 | bottom *= 4 39 | left *= 4 40 | cv2.rectangle(frame, (left, top), (right, bottom), (0, 0, 255), 2) 41 | cv2.rectangle(frame, (left, bottom - 35), (right, bottom), (0, 0, 255), cv2.FILLED) 42 | font = cv2.FONT_HERSHEY_DUPLEX 43 | cv2.putText(frame, name, (left + 6, bottom - 6), font, 1.0, (255, 255, 255), 1) 44 | cv2.imshow('Video', frame) 45 | if cv2.waitKey(1) & 0xFF == ord('q'): 46 | break 47 | video_capture.release() 48 | cv2.destroyAllWindows() -------------------------------------------------------------------------------- /app/requirements.txt: -------------------------------------------------------------------------------- 1 | apturl==0.5.2 2 | bcrypt==3.1.7 3 | blinker==1.4 4 | Brlapi==0.8.2 5 | cachetools==4.2.4 6 | certifi==2020.6.20 7 | chardet==4.0.0 8 | charset-normalizer==2.1.0 9 | click==8.1.3 10 | cmake==3.18.2.post1 11 | colorama==0.4.4 12 | command-not-found==0.3 13 | cryptography==3.3.2 14 | cupshelpers==1.0 15 | dbus-python==1.2.16 16 | decorator==4.4.2 17 | defer==1.0.6 18 | distro==1.5.0 19 | distro-info==1.0 20 | dlib==19.24.0 21 | dotenv-python==0.0.1 22 | duplicity==0.8.17 23 | face-recognition==1.3.0 24 | face-recognition-models==0.3.0 25 | fasteners==0.14.1 26 | Flask==2.1.3 27 | future==0.18.2 28 | geographiclib==1.52 29 | geopy==2.2.0 30 | httplib2==0.18.1 31 | idna==2.10 32 | imageio==2.20.0 33 | imageio-ffmpeg==0.4.7 34 | importlib-metadata==4.12.0 35 | ipregistry==3.2.0 36 | itsdangerous==2.1.2 37 | jeepney==0.6.0 38 | Jinja2==3.1.2 39 | keyring==22.2.0 40 | language-selector==0.1 41 | launchpadlib==1.10.13 42 | lazr.restfulclient==0.14.2 43 | lazr.uri==1.0.5 44 | lockfile==0.12.2 45 | louis==3.16.0 46 | macaroonbakery==1.3.1 47 | Mako==1.1.3 48 | MarkupSafe==2.1.1 49 | monotonic==1.5 50 | moviepy==1.0.3 51 | netifaces==0.10.9 52 | numpy==1.23.1 53 | oauthlib==3.1.0 54 | olefile==0.46 55 | opencv-python==4.6.0.66 56 | PAM==0.4.2 57 | paramiko==2.7.2 58 | pexpect==4.8.0 59 | Pillow==9.2.0 60 | proglog==0.1.10 61 | protobuf==3.12.4 62 | psycopg2-binary==2.9.3 63 | pycairo==1.16.2 64 | pycups==2.0.1 65 | PyGObject==3.38.0 66 | PyICU==2.5 67 | PyJWT==1.7.1 68 | pymacaroons==0.13.0 69 | PyNaCl==1.4.0 70 | pyRFC3339==1.1 71 | python-apt===2.2.0-ubuntu0.21.04.1 72 | python-dateutil==2.8.1 73 | python-debian==0.1.39 74 | python-dotenv==0.20.0 75 | pytz==2021.1 76 | pyxdg==0.27 77 | PyYAML==5.3.1 78 | reportlab==3.5.66 79 | requests==2.28.1 80 | SecretStorage==3.3.1 81 | simplejson==3.17.2 82 | six==1.16.0 83 | systemd-python==234 84 | tqdm==4.64.0 85 | ubuntu-advantage-tools==27.5 86 | ubuntu-drivers-common==0.0.0 87 | ufw==0.36 88 | unattended-upgrades==0.1 89 | urllib3==1.26.2 90 | usb-creator==0.3.7 91 | vboxapi==1.0 92 | wadllib==1.3.5 93 | Werkzeug==2.2.0 94 | wincertstore==0.2 95 | xdg==5 96 | xkit==0.0.0 97 | zipp==3.8.1 98 | -------------------------------------------------------------------------------- /app/static/css/case.css: -------------------------------------------------------------------------------- 1 | 2 | *{ 3 | margin: 0; 4 | padding: 0; 5 | box-sizing: border-box; 6 | font-family: montserrat,sans-serif; 7 | 8 | } 9 | .formdata{ 10 | position: fixed; 11 | top: 60%; 12 | left: 60%; 13 | transform: translate(-50%, -50%); 14 | 15 | 16 | } 17 | .preview{ 18 | margin-top: 5%; 19 | } 20 | .name{ 21 | width: 60%; 22 | height: 20px; 23 | border-radius: 1px; 24 | border: 1px solid; 25 | border-radius: 5px; 26 | 27 | } 28 | .fname{ 29 | width: 60%; 30 | height: 20px; 31 | border-radius: 1px; 32 | border: 1px solid; 33 | border-radius: 5px; 34 | margin-top: 10px; 35 | 36 | } 37 | .age{ 38 | width: 10%; 39 | height: 20px; 40 | border-radius: 1px; 41 | border: 1px solid; 42 | border-radius: 5px; 43 | margin-top: 10px; 44 | } 45 | .number{ 46 | width: 48%; 47 | height: 20px; 48 | border-radius: 1px; 49 | border: 1px solid; 50 | border-radius: 5px; 51 | margin-top: 10px; 52 | margin-left: 2%; 53 | 54 | } 55 | .location{ 56 | width: 60%; 57 | height: 20px; 58 | border-radius: 1px; 59 | border: 1px solid; 60 | border-radius: 5px; 61 | margin-top: 10px; 62 | } 63 | 64 | input{ 65 | padding-top: 2%; 66 | } 67 | .data{ 68 | display: flex; 69 | flex-direction: column; 70 | } 71 | .btn-save{ 72 | width: 100px; 73 | height: 30px; 74 | margin-top: 3%; 75 | background-color: #D82148; 76 | border: #D82148; 77 | color: beige; 78 | } 79 | -------------------------------------------------------------------------------- /app/static/css/feedback.css: -------------------------------------------------------------------------------- 1 | 2 | *{ 3 | padding:0; 4 | margin: 0; 5 | font-family: sans-serif; 6 | box-sizing: border-box; 7 | outline: none; 8 | color: #ffffff; 9 | } 10 | section{ 11 | position: absolute; 12 | height: 100%; 13 | width:100%; 14 | background:url(blud.jpeg); 15 | background-size: cover; 16 | background-position: center; 17 | filter:blur(2px) brightness(30%); 18 | } 19 | 20 | body 21 | { 22 | font: 15px/1.5 Arial, Helvetica,sans-serif; 23 | padding:0; 24 | margin:0; 25 | background-color: #008080; 26 | 27 | } 28 | 29 | header { 30 | background:#4682b4; 31 | color:#ffffff; 32 | padding-top:0px; 33 | min-height:50px; 34 | border-bottom:red 3px solid; 35 | } 36 | #container{ 37 | width:80%; 38 | margin:auto; 39 | overflow:hidden; 40 | } 41 | #container img 42 | { 43 | width:10%; 44 | min-height: 10px 45 | } 46 | #navbar 47 | { 48 | height: 100px; 49 | width: 100%; 50 | background: rgba(0,0,0,1); 51 | } 52 | #navbar ul{ 53 | float:right; 54 | margin-right: 20px 55 | } 56 | #navbar ul li{ 57 | list-style: none; 58 | margin: 0 8px; 59 | display: inline-block; 60 | line-height: 80px 61 | } 62 | #navbar ul li a{ 63 | text-decoration: none; 64 | color:white; 65 | font-size: 20px; 66 | padding: 6px 13px; 67 | font-family: 'Roboto',sans-serif; 68 | transform: .4s; 69 | } 70 | #navbar ul li a.active, 71 | #navbar ul li a:hover{ 72 | background: red; 73 | border-radius: 2px; 74 | 75 | } 76 | 77 | 78 | #form 79 | { 80 | 81 | display: block; 82 | text-align: center; 83 | 84 | } 85 | form 86 | { 87 | width: 360px; 88 | min-height: 200px; 89 | background: #000; 90 | box-shadow: 0 0 8px rgba(250,250,250,0.6); 91 | opacity: 0.6; 92 | display: inline-block; 93 | margin-left: center; 94 | margin-top:4cm; 95 | text-align: center; 96 | padding: 25px 20px; 97 | } 98 | form #id{ 99 | position: relative; 100 | } 101 | form input{ 102 | width: 100%; 103 | height: 50px; 104 | margin: 4px; 105 | border: 1px solid #5c5c5c; 106 | border-radius: 3px; 107 | background:#181717; 108 | padding: 0 15px; 109 | padding-right: 45px; 110 | font-size: 20px 111 | 112 | } 113 | form textarea{ 114 | padding: 5px 15px ; 115 | border: 1px solid #5c5c5c; 116 | border-radius: 3px; 117 | background:#181717; 118 | font-size: 20px; 119 | width:100%; 120 | } 121 | form button{ 122 | margin-top: 5px; 123 | border: none; 124 | background: #00fff0; 125 | color: #222; 126 | padding: 10px 0; 127 | width: 100%; 128 | font-size: 20px; 129 | font-weight: 800; 130 | cursor:pointer; 131 | border-radius: 3px; 132 | 133 | 134 | } 135 | #footer{ 136 | 137 | color:white; 138 | background-color:#181514; 139 | font-weight: bold; 140 | text-align: center; 141 | } -------------------------------------------------------------------------------- /app/static/css/policehome.css: -------------------------------------------------------------------------------- 1 | *{ 2 | padding: 0; 3 | margin: 0; 4 | } 5 | 6 | .container{ 7 | background-color:#060227; 8 | width: 100%; 9 | min-height: 100vh; 10 | 11 | } 12 | .police-nav{ 13 | background-color: #00021d; 14 | height: 60px; 15 | display: flex; 16 | align-items: center; 17 | justify-content: space-between; 18 | 19 | } 20 | .p-title p{ 21 | color: white; 22 | margin-left: 25%; 23 | width: 100%; 24 | font-size: 1.2em; 25 | } 26 | .nav-links{ 27 | color: white; 28 | display: flex; 29 | margin-right: 5%; 30 | align-items: center; 31 | 32 | 33 | } 34 | .nav-links a{ 35 | padding-left: 25%; 36 | color: white; 37 | text-decoration: none; 38 | font-weight: 500; 39 | font-size: 0.9em; 40 | } 41 | a:hover{ 42 | color: red; 43 | } 44 | 45 | 46 | table{ 47 | padding-bottom: 5%; 48 | } 49 | 50 | .details{ 51 | color: white; 52 | width: 90%; 53 | margin-top: 2.5%; 54 | } 55 | th{ 56 | border: 1px solid white; 57 | text-align: center; 58 | padding: 3%; 59 | } 60 | 61 | td{ 62 | text-align: center; 63 | padding: 2%; 64 | border: 1px solid white; 65 | } 66 | 67 | .train_msg{ 68 | color: red; 69 | margin-top: 5%; 70 | } 71 | -------------------------------------------------------------------------------- /app/static/css/results.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background-color: #060227; 3 | color: white; 4 | 5 | } 6 | .p-title p{ 7 | color: white; 8 | margin-left: 25%; 9 | width: 100%; 10 | font-size: 1.2em; 11 | } 12 | 13 | #logout{ 14 | color: white; 15 | text-decoration: none; 16 | } 17 | .resultcontainer{ 18 | display: flex; 19 | align-items: center; 20 | justify-content: space-between; 21 | 22 | } 23 | 24 | .personal-details{ 25 | padding-left: 5%; 26 | } 27 | .details{ 28 | width: 100%; 29 | display: flex; 30 | align-items: center; 31 | justify-content: center; 32 | padding-top: 10%; 33 | } 34 | .spotedimage img{ 35 | width: 150px; 36 | padding: 5%; 37 | } 38 | 39 | nav{ 40 | background-color: #00021d; 41 | height: 60px; 42 | display: flex; 43 | align-items: center; 44 | justify-content: space-between; 45 | margin-top: -5px; 46 | } -------------------------------------------------------------------------------- /app/static/css/style.css: -------------------------------------------------------------------------------- 1 | 2 | @import url('https://fonts.googleapis.com/css?family=Roboto:700&display=swap'); 3 | *{ 4 | padding:0; 5 | margin: 0; 6 | } 7 | 8 | 9 | .life{ 10 | /* max-height: 100vh; 11 | overflow: hidden; 12 | width: 100vw; */ 13 | 14 | } 15 | #myVideo 16 | { 17 | 18 | width: 100%; 19 | height: 100%; 20 | object-fit: cover; 21 | margin-top: -10px; 22 | } 23 | 24 | 25 | /*section 26 | { 27 | 28 | }*/ 29 | .title h1{ 30 | color: white; 31 | margin-left: 20%; 32 | width: 100%; 33 | } 34 | nav{ 35 | background-color: #060227; 36 | height: 70px; 37 | align-items: center; 38 | display: flex; 39 | justify-content: space-between; 40 | 41 | } 42 | h1{ 43 | color: white; 44 | margin-left: 10%; 45 | width: 100%; 46 | } 47 | .nav-links{ 48 | color: white; 49 | margin-right: 25%; 50 | } 51 | .nav-links a{ 52 | color: white; 53 | padding: 25px; 54 | } 55 | 56 | .navbar 57 | { 58 | display: flex; 59 | align-items: center; 60 | justify-content: space-between; 61 | height: 75px; 62 | width: 100%; 63 | /* background: rgba(0,0,0,0.5); */ 64 | background: linear-gradient(60deg, rgba(2,0,36,1) 0%, rgba(9,8,115,0.9724264705882353) 28%, rgba(9,9,121,0.8743872549019608) 53%, rgba(0,212,255,1) 100%); 65 | 66 | } 67 | 68 | .logo 69 | { 70 | width:130px; 71 | height:auto; 72 | padding:5px 100px; 73 | 74 | 75 | } 76 | 77 | .navbar ul{ 78 | float:right; 79 | margin-right: 20px 80 | } 81 | .navbar ul li{ 82 | list-style: none; 83 | margin: 0 8px; 84 | display: inline-block; 85 | line-height: 80px 86 | } 87 | .navbar ul li a{ 88 | text-decoration: none; 89 | color:white; 90 | font-size: 1.1em; 91 | padding: 6px 13px; 92 | font-family: 'Roboto',sans-serif; 93 | transform: .4s; 94 | } 95 | .navbar ul li a.active, 96 | .navbar ul li a:hover{ 97 | background: blue; 98 | border-radius: 2px; 99 | 100 | } 101 | .life .center{ 102 | position: absolute; 103 | top: 50%; 104 | left: 50%; 105 | transform: translate(-50%,-50%); 106 | font-family: sans-serif; 107 | user-select: none; 108 | } 109 | .center h1 110 | {color: rgb(0, 225, 255); 111 | font-size: 60px; 112 | text-shadow: -1px 1px 2px #000, 113 | 1px 1px 2px #000, 114 | 1px -1px 0 #000, 115 | -1px -1px 0 #000; 116 | 117 | text-align: center; 118 | } 119 | .center h3 120 | {color: white; 121 | font-size: 40px; 122 | text-shadow: -1px 1px 2px #000, 123 | 1px 1px 2px #000, 124 | 1px -1px 0 #000, 125 | -1px -1px 0 #000; 126 | text-align: center; 127 | } 128 | a{ 129 | text-decoration: none; 130 | color:rebeccapurple; 131 | font-weight: bold; 132 | } 133 | .center .buttons{ 134 | margin: 35px 280px; 135 | } 136 | .buttons button{ 137 | height: 50px; 138 | width:150px; 139 | font-size: 18px; 140 | font-weight: bold; 141 | color: #ffb3b3 ; 142 | background:white; 143 | border:2px solid #cc0000; 144 | 145 | outline:none; 146 | cursor: pointer; 147 | border-radius: 25px; 148 | transition: .5s; 149 | 150 | } 151 | .button.btn 152 | { 153 | margin-left:50px; 154 | 155 | } 156 | .button button , hover{ 157 | background: #cc0000; 158 | } 159 | .footer{ 160 | padding:25px; 161 | margin-bottom: 50px; 162 | color:white; 163 | background-color:#181514; 164 | font-weight: bold; 165 | text-align: center; 166 | } 167 | #form{ 168 | width: 100%; 169 | height:100%; 170 | color: red; 171 | } 172 | body{ 173 | height: fit-content; 174 | width: 100%; 175 | } 176 | 177 | table { 178 | border-collapse: separate; 179 | border-spacing: 1px 0; 180 | background-color: white; 181 | align-content: center; 182 | 183 | 184 | 185 | } 186 | /* 187 | td { 188 | padding: 5px 0; 189 | } 190 | th { 191 | padding: 5px 0; 192 | } 193 | */ 194 | h2{ 195 | color:darkblue; 196 | 197 | } -------------------------------------------------------------------------------- /app/static/css/style1.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700&display=swap'); 2 | @import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css'); 3 | body{ 4 | margin: 0; 5 | padding: 0; 6 | font-family: 'Poppins' , sans-serif ; 7 | background-image: url(../img/bd.jpg); 8 | background-size: cover; 9 | } 10 | .login-box{ 11 | width: 280px; 12 | position: absolute; 13 | top: 50%; 14 | left: 50%; 15 | transform: translate(-50%,-50%); 16 | color: white; 17 | } 18 | .login-box h1{ 19 | float: left; 20 | font-size: 40px; 21 | border-bottom: 6px solid red; 22 | margin-bottom: 50px; 23 | padding: 13px 0; 24 | } 25 | .text-box{ 26 | width: 100%; 27 | overflow: hidden; 28 | font-size: 20px; 29 | padding: 8px 0; 30 | margin: 8px 0; 31 | border-bottom: 1px solid red; 32 | } 33 | .text-box i{ 34 | width: 26px; 35 | float:left; 36 | text-align: center; 37 | } 38 | .text-box input{ 39 | border: none; 40 | outline: none; 41 | background: none; 42 | color: white; 43 | font-size: 18px; 44 | width: 100px; 45 | float: left; 46 | margin: 0 10px; 47 | } 48 | .text-box select{ 49 | border: red; 50 | background: none; 51 | outline: gray; 52 | color: rgb(102, 101, 101); 53 | font-size: 18px; 54 | width:75%; 55 | float: left; 56 | margin: 0 10px; 57 | margin-top: 4px; 58 | } 59 | .btn{ 60 | width: 100%; 61 | background: none; 62 | cursor: pointer; 63 | border:2px solid red; 64 | color: white; 65 | font-size: 18px; 66 | margin: 12px 0; 67 | } 68 | -------------------------------------------------------------------------------- /app/static/css/style2.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700&display=swap'); 2 | @import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css'); 3 | body{ 4 | margin: 0; 5 | padding: 0; 6 | font-family: 'Poppins' , sans-serif ; 7 | 8 | } 9 | .life 10 | { 11 | background: rgb(2,0,36); 12 | background-image: linear-gradient(60deg, rgba(2,0,36,1) 0%, rgba(9,8,115,0.9724264705882353) 28%, rgba(9,9,121,0.8743872549019608) 53%, rgba(0,212,255,1) 100%); 13 | background-image: cover; 14 | } 15 | .navbar 16 | { 17 | height: 80px; 18 | width: 100%; 19 | background: rgba(0,0,0,0.5); 20 | } 21 | .navbar ul{ 22 | float:right; 23 | margin-right: 20px 24 | } 25 | .navbar ul li{ 26 | list-style: none; 27 | margin: 0 8px; 28 | display: inline-block; 29 | line-height: 80px 30 | } 31 | .navbar ul li a{ 32 | text-decoration: none; 33 | color:white; 34 | font-size: 20px; 35 | padding: 6px 13px; 36 | font-family: 'Roboto',sans-serif; 37 | transform: .4s; 38 | } 39 | .navbar ul li a.active, 40 | .navbar ul li a:hover{ 41 | background-image: #D82148; 42 | border-radius: 2px; 43 | 44 | } 45 | 46 | .preview{ 47 | margin-top: 5%; 48 | } 49 | .login-box{ 50 | width: 300px; 51 | position: absolute; 52 | top: 50%; 53 | left: 50%; 54 | transform: translate(-50%,-50%); 55 | color: white; 56 | } 57 | 58 | .btn-save{ 59 | width: 100px; 60 | height: 30px; 61 | margin-top: 3%; 62 | background-color: #D82148; 63 | border: #D82148; 64 | color: beige; 65 | } 66 | .tit{ 67 | float: left; 68 | font-size: 40px; 69 | border-bottom: 6px solid red; 70 | margin-bottom: 50px; 71 | padding: 13px 0; 72 | } 73 | 74 | .login-box h1{ 75 | float: left; 76 | font-size: 1.9em; 77 | border-bottom: 2px solid red; 78 | margin-bottom: 50px; 79 | padding: 8px 0; 80 | } 81 | .text-box{ 82 | width: 100%; 83 | overflow: hidden; 84 | font-size: 1.5em; 85 | padding: 8px 0; 86 | margin: 8px 0; 87 | border-bottom: 1px solid red; 88 | 89 | } 90 | 91 | .text-box1{ 92 | width: 45%; 93 | overflow: hidden; 94 | font-size: 20px; 95 | padding: 8px 0; 96 | margin: 8px 0; 97 | border-bottom: 1px solid red; 98 | } 99 | .text-box2{ 100 | width: 50%; 101 | overflow: hidden; 102 | font-size: 20px; 103 | padding: 8px 0; 104 | margin: 0 8px; 105 | border-bottom: 1px solid red; 106 | float: right; 107 | margin-top: -51px; 108 | } 109 | .text-box3{ 110 | width: 50%; 111 | overflow: hidden; 112 | font-size: 20px; 113 | padding: 8px 0; 114 | margin: 0 8px; 115 | border-bottom: 1px solid red; 116 | float: right; 117 | margin-top: -51px; 118 | } 119 | 120 | .text-box i{ 121 | width: 100px; 122 | float:left; 123 | text-align: center; 124 | margin-left: -10%; 125 | } 126 | 127 | .text-box1 i{ 128 | width: 100px; 129 | float:left; 130 | text-align: center; 131 | } 132 | .text-box2 i{ 133 | width: 100px; 134 | float:left; 135 | text-align: center; 136 | } 137 | 138 | .text-box input{ 139 | border: none; 140 | outline: none; 141 | background: none; 142 | color: white; 143 | font-size: 18px; 144 | width: 150px; 145 | float: left; 146 | margin: 0 10px; 147 | 148 | } 149 | .text-box1 select{ 150 | border: red; 151 | background: none; 152 | outline: gray; 153 | color: rgb(102, 101, 101); 154 | font-size: 18px; 155 | width:75%; 156 | float: left; 157 | margin: 0 10px; 158 | } 159 | .text-box1 input{ 160 | border: none; 161 | outline: none; 162 | background: none; 163 | color: white; 164 | font-size: 18px; 165 | width: 150px; 166 | float: left; 167 | margin: 0 10px; 168 | } 169 | .text-box2 input{ 170 | border: none; 171 | outline: none; 172 | background: none; 173 | color: white; 174 | font-size: 18px; 175 | width: 300px; 176 | float: left; 177 | margin: 0 10px; 178 | } 179 | label{ 180 | color:grey; 181 | font-size: 10px; 182 | 183 | 184 | } 185 | 186 | .text-box1 select{ 187 | border: red; 188 | background: none; 189 | outline: gray; 190 | color: rgb(102, 101, 101); 191 | font-size: 18px; 192 | width:75%; 193 | float: left; 194 | margin: 0 10px; 195 | } 196 | .text-box .datepicker-input{ 197 | color: gray; 198 | width: 200%; 199 | 200 | } 201 | .text-box2 select{ 202 | border: red; 203 | background: none; 204 | outline: gray; 205 | color: rgb(102, 101, 101); 206 | font-size: 18px; 207 | width:75%; 208 | float: left; 209 | margin: 0 10px; 210 | margin-top: 4px; 211 | } 212 | 213 | 214 | 215 | .btn{ 216 | width: 100%; 217 | background: red; 218 | cursor: pointer; 219 | border:2px solid red; 220 | color: white; 221 | font-size: 1.1em; 222 | margin: 12px 0; 223 | height: 40px; 224 | border-radius: 5px; 225 | 226 | 227 | } 228 | .btn a{ 229 | text-decoration: none; 230 | color: white; 231 | } 232 | 233 | #output{ 234 | width: auto; 235 | height: 150px; 236 | 237 | } 238 | #br{ 239 | background: none; 240 | color: white; 241 | border: none; 242 | } 243 | -------------------------------------------------------------------------------- /app/static/css/stylecs: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=poppins:wght@200;300;400;500;600;700;900&display=swap'); 2 | * -------------------------------------------------------------------------------- /app/static/css/stylecs.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=poppins:wght@200;300;400;500;600;700;900&display=swap'); 2 | * 3 | { 4 | margin-left: 0; 5 | padding: 0; 6 | box-sizing: border-box; 7 | 8 | font-family: 'poppins',sans-serif; 9 | } 10 | .contact{ 11 | position: relative; 12 | min-height: 100vh; 13 | padding: 50px 100px; 14 | display: flex; 15 | justify-content: center; 16 | align-items: center; 17 | flex-direction: column; 18 | background: url(blood.jpg); 19 | background-size: cover; 20 | } 21 | .contact .contant{ 22 | max-width: 800px; 23 | text-align: center; 24 | } 25 | .contact .contant h2{ 26 | font-size: 36px; 27 | font-weight: 500px; 28 | color: black; 29 | } 30 | .contact .contant p{ 31 | font-size: 30px; 32 | color: black; 33 | } 34 | .container 35 | { 36 | width: 100%; 37 | display: flex; 38 | margin-left: 30px; 39 | align-items: center; 40 | margin-top: 30px; 41 | } 42 | .container.contactinfo 43 | { 44 | width: 50%; 45 | padding: 20px 0; 46 | display: flex; 47 | } 48 | .container.contactinfo.box 49 | { 50 | position: relative; 51 | padding: 20px 0; 52 | display: flex; 53 | } 54 | .container.contactinfo.box.icon { 55 | min-width: 60px; 56 | height: 60px; 57 | background:"fff"; 58 | display: flex; 59 | justify-content: center; 60 | align-items: center; 61 | border-radius: 50%: 62 | font-size:30px; 63 | 64 | } 65 | .container.contactinfo.box.text 66 | { 67 | display: flex; 68 | 69 | margin-left: 20px 70 | font-size: 16px; 71 | color: black; 72 | 73 | flex-direction: column; 74 | font-weight:300 ; 75 | 76 | } 77 | .container.contactinfo.box.text h3 78 | { 79 | 80 | font-weight:500 ; 81 | color: #00bcd4; 82 | 83 | 84 | } 85 | .contactform { 86 | width: 50%; 87 | padding:100px; 88 | 89 | background:#fff; 90 | } 91 | .contactform h2{ 92 | font-size: 30px; 93 | color:#333; 94 | font-weight: 400; 95 | 96 | } 97 | .contactform .inputBox{ 98 | position: relative; 99 | width:100%; 100 | margin-top: 10px; 101 | } 102 | .contactform .inputBox input{ 103 | width: 100%; 104 | padding: 5px 0; 105 | font-size: 16px; 106 | margin: 10px 0; 107 | border: none; 108 | border-bottom: 2px solid #333; 109 | outline:none; 110 | } 111 | .contactform .inputBox input 112 | .contactform .inputBox textarea 113 | { 114 | width: 100%; 115 | padding: 5px 0; 116 | font-size: 16px; 117 | margin: 10px 0; 118 | border: none; 119 | border-bottom: 2px solid #333; 120 | outline:none; 121 | } 122 | .contactform .inputBox span 123 | { 124 | position: absolute; 125 | left: 0; 126 | padding: 5px 0; 127 | font-size: 16px; 128 | margin: 10px 0; 129 | pointer-events: none; 130 | transition:0.5s; 131 | color: #666; 132 | } 133 | .contactform .inputBox input:focus~ span, 134 | .contactform .inputBox input:valid~ span, 135 | .contactform .inputBox textarea:focus~ span, 136 | .contactform .inputBox textarea:valid~ span 137 | { 138 | color: #e91e63; 139 | font-size: 12px; 140 | transform: translate(-20px); 141 | 142 | } 143 | .contactform .inputBox input[type="submit"] 144 | { 145 | width: 100px; 146 | background:#8b0000; 147 | border: none; 148 | cursor: pointer; 149 | padding: 10px; 150 | font-size: 18px; 151 | } 152 | .footer{ 153 | padding:25px; 154 | margin-bottom: : 50px; 155 | color:white; 156 | background-color:#181514; 157 | font-weight: bold; 158 | text-align: center; 159 | } 160 | @media(max-width: 991px){ 161 | .contact 162 | { 163 | padding: 50px; 164 | } 165 | .container 166 | { 167 | flex-direction: column; 168 | 169 | } 170 | .container .contactinfo{ 171 | margin-bottom: 40px; 172 | 173 | } 174 | .container .contactinfo, 175 | .contactform 176 | { 177 | width: 100%; 178 | 179 | 180 | } -------------------------------------------------------------------------------- /app/static/img/bgvdo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/img/bgvdo.mp4 -------------------------------------------------------------------------------- /app/static/img/police.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/img/police.png -------------------------------------------------------------------------------- /app/static/screenshots/Neeraj Ram1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/screenshots/Neeraj Ram1.jpg -------------------------------------------------------------------------------- /app/static/screenshots/Neeraj1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/screenshots/Neeraj1.jpg -------------------------------------------------------------------------------- /app/static/screenshots/Nidhin1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/screenshots/Nidhin1.jpg -------------------------------------------------------------------------------- /app/static/screenshots/Ronaldo1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/screenshots/Ronaldo1.jpg -------------------------------------------------------------------------------- /app/static/screenshots/dq1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/screenshots/dq1.jpg -------------------------------------------------------------------------------- /app/static/uploads/1329279.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/1329279.jpg -------------------------------------------------------------------------------- /app/static/uploads/Ashwin_Photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/Ashwin_Photo.jpg -------------------------------------------------------------------------------- /app/static/uploads/IMG20220519200733.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/IMG20220519200733.jpg -------------------------------------------------------------------------------- /app/static/uploads/IMG_17965.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/IMG_17965.jpg -------------------------------------------------------------------------------- /app/static/uploads/IMG_20201121_011127_564.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/IMG_20201121_011127_564.jpg -------------------------------------------------------------------------------- /app/static/uploads/Mohanlal1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/Mohanlal1.jpg -------------------------------------------------------------------------------- /app/static/uploads/Neeraj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/Neeraj.gif -------------------------------------------------------------------------------- /app/static/uploads/Neeraj.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/Neeraj.jpg -------------------------------------------------------------------------------- /app/static/uploads/Neeraj2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/Neeraj2.jpg -------------------------------------------------------------------------------- /app/static/uploads/Photo-1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/Photo-1.jpeg -------------------------------------------------------------------------------- /app/static/uploads/Renjith_R.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/Renjith_R.jpg -------------------------------------------------------------------------------- /app/static/uploads/Resus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/Resus.png -------------------------------------------------------------------------------- /app/static/uploads/WhatsApp_Image_2022-05-26_at_10.05.01_AM.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/WhatsApp_Image_2022-05-26_at_10.05.01_AM.jpeg -------------------------------------------------------------------------------- /app/static/uploads/WhatsApp_Image_2022-05-26_at_10.05.03_AM1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/WhatsApp_Image_2022-05-26_at_10.05.03_AM1.jpeg -------------------------------------------------------------------------------- /app/static/uploads/cr7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/cr7.jpg -------------------------------------------------------------------------------- /app/static/uploads/dq2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/dq2.jpg -------------------------------------------------------------------------------- /app/static/uploads/hrithik.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/hrithik.jpg -------------------------------------------------------------------------------- /app/static/uploads/icons8-nfc-n-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/icons8-nfc-n-16.png -------------------------------------------------------------------------------- /app/static/uploads/icons8-react-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/icons8-react-100.png -------------------------------------------------------------------------------- /app/static/uploads/messi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/messi.jpg -------------------------------------------------------------------------------- /app/static/uploads/messi2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neerajram30/God-s-Eye/18a96da6a4b4832580a161237b01f05d00c0e11b/app/static/uploads/messi2.jpg -------------------------------------------------------------------------------- /app/templates/admin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Admin 6 | 7 | 8 | 9 | 10 | 11 |
12 |

Admin Login

13 | 14 |
15 |
16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 |
25 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/templates/adminhome.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Admin portal 9 | 10 | 11 |
12 | 26 |
27 |
28 |
29 | {% with messages = get_flashed_messages() %} 30 | {% if messages %} 31 | {% for message in messages %} 32 |

{{ message }}

33 | {% endfor %} 34 | {% endif %} 35 | {% endwith %} 36 |
37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | {% for row in value %} 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | {% endfor %} 61 | 62 |
NameMobileLocationDateAge
{{row[1]}}{{row[2]}}{{row[6]}}{{row[3]}}{{row[4]}}
63 |
64 |
65 | 66 |
67 | 68 | -------------------------------------------------------------------------------- /app/templates/index.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | God's Eye Home 26 | 27 | 28 | 29 | 30 | 39 |
40 |
41 | 42 | 43 | 46 | 47 | 48 |
49 |
50 | 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /app/templates/login.html: -------------------------------------------------------------------------------- 1 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Police login portal 39 | 40 | 41 | 42 | 43 | 44 |
45 |

Police Login

46 | 47 |
48 |
49 | 50 | 51 | 52 |
53 |
54 | 55 | 56 | 57 |
58 |
59 | 60 | 61 | 62 |
63 | 64 | 65 |
66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /app/templates/newcase.html: -------------------------------------------------------------------------------- 1 | 49 | 50 | 51 | 52 | 53 | 54 | Case Registration 55 | 56 | 57 | 58 | 59 | 60 |
61 |

Register Case

62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 |
71 | 72 |
73 | 74 |
75 | 76 |
77 | 78 |
79 | 80 |
81 | 82 | 83 | 92 |
93 |
94 | 95 | 96 | 97 | 98 |
99 | 100 | -------------------------------------------------------------------------------- /app/templates/policehome.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Police portal 9 | 10 | 11 |
12 | 28 |
29 |
30 |
31 | {% with messages = get_flashed_messages() %} 32 | {% if messages %} 33 | {% for message in messages %} 34 |

{{ message }}

35 | {% endfor %} 36 | {% endif %} 37 | {% endwith %} 38 |
39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | {% for row in value %} 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | {% endfor %} 63 | 64 |
NameMobileLocationDateAge
{{row[1]}}{{row[2]}}{{row[6]}}{{row[3]}}{{row[4]}}
65 |
66 |
67 | 68 |
69 | 70 | -------------------------------------------------------------------------------- /app/templates/register.html: -------------------------------------------------------------------------------- 1 | 36 | 37 | 38 | 39 | 40 | 41 | Police registration portal 42 | 43 | 44 | 45 | 46 | 47 | 48 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /app/templates/result.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Final Results

4 | 5 | 6 | 7 | {% for key,value in result.items() %} 8 | 9 | {# This is the comment sections #} 10 | 11 | 12 | 13 | 14 | {% endfor %} 15 |
{{ key }}{{ value }}
16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/templates/results.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Results 9 | 10 | 11 |
12 | 13 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | {% for row in value %} 28 | {% for i in row[1] %} 29 | {% for j in row[2] %} 30 | {% for k in row[3] %} 31 | {% for l in row[4] %} 32 | 33 | 34 | 35 | 40 | 41 | 42 | {% endfor %} 43 | {% endfor %} 44 | 45 | {% endfor %} 46 | {% endfor %} 47 | 48 | {% endfor %} 49 | 50 | 51 | 52 |
36 |

Name: {{k}}

37 |

Location : {{j}}

38 |

Date : {{l}}

39 |
53 |
54 | 55 | -------------------------------------------------------------------------------- /app/templates/user.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Case Registration 6 | 7 | 8 | 9 | 10 | 11 |