{"id":19430720,"url":"https://github.com/jmrashed/face-detection-using-python-django","last_synced_at":"2026-03-02T19:37:09.120Z","repository":{"id":238827333,"uuid":"624120064","full_name":"jmrashed/Face-detection-using-python-Django","owner":"jmrashed","description":"Face detection using python Django","archived":false,"fork":false,"pushed_at":"2023-04-05T19:37:44.000Z","size":395,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-17T19:03:13.900Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmrashed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-05T19:37:01.000Z","updated_at":"2023-04-05T19:37:49.000Z","dependencies_parsed_at":"2024-05-08T11:41:31.711Z","dependency_job_id":null,"html_url":"https://github.com/jmrashed/Face-detection-using-python-Django","commit_stats":null,"previous_names":["jmrashed/face-detection-using-python-django","mrzstack/face-detection-using-python-django"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jmrashed/Face-detection-using-python-Django","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrashed%2FFace-detection-using-python-Django","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrashed%2FFace-detection-using-python-Django/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrashed%2FFace-detection-using-python-Django/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrashed%2FFace-detection-using-python-Django/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmrashed","download_url":"https://codeload.github.com/jmrashed/Face-detection-using-python-Django/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrashed%2FFace-detection-using-python-Django/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30016539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T17:00:27.440Z","status":"ssl_error","status_checked_at":"2026-03-02T17:00:03.402Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T14:26:18.191Z","updated_at":"2026-03-02T19:37:09.073Z","avatar_url":"https://github.com/jmrashed.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Face detection using python Django\n\nFace detection can be implemented in Python using the OpenCV library, which is a computer vision library that contains a variety of algorithms for image processing and object detection\n\n## Installation\nTo integrate face detection into a Django web application, you can follow these steps:\n\n1. Install the OpenCV library by running the following command in your terminal or command prompt:\n`pip install opencv-python`\n\n2. Create a Django view function that takes an image file as input and returns whether or not a face is detected in the image.\n```python\nimport cv2\n\ndef detect_face(image_file):\n    # Load the image file\n    image = cv2.imread(image_file)\n\n    # Convert the image to grayscale\n    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)\n\n    # Load the face cascade classifier\n    face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')\n\n    # Detect faces in the image\n    faces = face_cascade.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=5)\n\n    # If a face is detected, return True; otherwise, return False\n    if len(faces) \u003e 0:\n        return True\n    else:\n        return False\n\n```\n\n3. In your Django template, create a form that allows users to upload an image file and submit it to the view function.\n```html\n\u003cform method=\"post\" enctype=\"multipart/form-data\"\u003e\n    {% csrf_token %}\n    \u003cinput type=\"file\" name=\"image_file\"\u003e\n    \u003cbutton type=\"submit\"\u003eDetect Face\u003c/button\u003e\n\u003c/form\u003e\n```\n\n4. In your Django view function, check if the form has been submitted and call the detect_face function with the uploaded image file.\n\n```python\nfrom django.shortcuts import render\nfrom django.http import HttpResponse\n\ndef face_detection(request):\n    if request.method == 'POST':\n        # Get the uploaded image file\n        image_file = request.FILES['image_file']\n\n        # Call the detect_face function\n        is_face_detected = detect_face(image_file)\n\n        # Render the results in a template\n        return render(request, 'face_detection_result.html', {'is_face_detected': is_face_detected})\n    else:\n        # Render the form\n        return render(request, 'face_detection.html')\n\n```\n5. Create a template for the results of the face detection.\n\n```html\n{% if is_face_detected %}\n    \u003cp\u003eA face was detected in the image!\u003c/p\u003e\n{% else %}\n    \u003cp\u003eNo faces were detected in the image.\u003c/p\u003e\n{% endif %}\n\n```\nWith these steps, you should now have a basic implementation of face detection in your Django web application.\n \n \n## How to run this project on your system\n\nFirst clone the project and extract the files on your system.\n\nThen open powershell on the same folder and run the command  ( `pip install -r req.txt`  )\n\nBe sure that the  libraries::\n\nasgiref==3.3.1,\n\nclick==7.1.2,\n\ncmake==3.18.4.post1,\n\nDjango==3.1.3,\n\ndlib==19.21.0,\n\nface-recognition==1.3.0,\n\nface-recognition-models==0.3.0,\n\nnumpy==1.19.3,\n\nopencv-python==4.4.0.46,\n\nPillow==8.0.1,\n\nplaysound==1.2.2,\n\npytz==2020.4,\n\nsqlparse==0.4.1   are properly installed.\n\nAfter that open project on vs code and in new terminal run the command  ( `python manage.py runserver`  ). Make sure that you are in the same directory othervise no such file or directory present error will show. For this you can run the command- cd face_recognition_attendance_system-dev \n\nThe id and password for admin login is (id=arun) and (password=arun), however you can change it by running the command ( python manage.py createsuperuser  )\n\n![Screenshot (314)](https://user-images.githubusercontent.com/98249951/170855597-2eaf00c8-4029-4017-a5e0-2d4617520388.png)\n\n![Screenshot (315)](https://user-images.githubusercontent.com/98249951/170855598-811a6af1-9ade-46a1-95f6-8e1b38acdc2c.png)\n\n![Screenshot (316)](https://user-images.githubusercontent.com/98249951/170855601-f9ab1748-0300-4c11-bbf9-607e1459c1fd.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmrashed%2Fface-detection-using-python-django","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmrashed%2Fface-detection-using-python-django","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmrashed%2Fface-detection-using-python-django/lists"}