@ -0,0 +1,150 @@
|
|||||||
|
# Created by https://www.gitignore.io/api/vim,linux,python
|
||||||
|
# Edit at https://www.gitignore.io/?templates=vim,linux,python
|
||||||
|
|
||||||
|
### Linux ###
|
||||||
|
*~
|
||||||
|
|
||||||
|
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||||
|
.fuse_hidden*
|
||||||
|
|
||||||
|
# KDE directory preferences
|
||||||
|
.directory
|
||||||
|
|
||||||
|
# Linux trash folder which might appear on any partition or disk
|
||||||
|
.Trash-*
|
||||||
|
|
||||||
|
# .nfs files are created when an open file is removed but is still being accessed
|
||||||
|
.nfs*
|
||||||
|
|
||||||
|
### Python ###
|
||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
wheels/
|
||||||
|
pip-wheel-metadata/
|
||||||
|
share/python-wheels/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
MANIFEST
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
# Usually these files are written by a python script from a template
|
||||||
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.nox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.cache
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
*.cover
|
||||||
|
.hypothesis/
|
||||||
|
.pytest_cache/
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.mo
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Scrapy stuff:
|
||||||
|
.scrapy
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
|
||||||
|
# PyBuilder
|
||||||
|
target/
|
||||||
|
|
||||||
|
# pyenv
|
||||||
|
.python-version
|
||||||
|
|
||||||
|
# pipenv
|
||||||
|
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||||
|
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||||
|
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||||
|
# install all needed dependencies.
|
||||||
|
#Pipfile.lock
|
||||||
|
|
||||||
|
# celery beat schedule file
|
||||||
|
celerybeat-schedule
|
||||||
|
|
||||||
|
# SageMath parsed files
|
||||||
|
*.sage.py
|
||||||
|
|
||||||
|
# Spyder project settings
|
||||||
|
.spyderproject
|
||||||
|
.spyproject
|
||||||
|
|
||||||
|
# Rope project settings
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
|
# Mr Developer
|
||||||
|
.mr.developer.cfg
|
||||||
|
.project
|
||||||
|
.pydevproject
|
||||||
|
|
||||||
|
# mkdocs documentation
|
||||||
|
/site
|
||||||
|
|
||||||
|
# mypy
|
||||||
|
.mypy_cache/
|
||||||
|
.dmypy.json
|
||||||
|
dmypy.json
|
||||||
|
|
||||||
|
# Pyre type checker
|
||||||
|
.pyre/
|
||||||
|
|
||||||
|
### Vim ###
|
||||||
|
# Swap
|
||||||
|
[._]*.s[a-v][a-z]
|
||||||
|
[._]*.sw[a-p]
|
||||||
|
[._]s[a-rt-v][a-z]
|
||||||
|
[._]ss[a-gi-z]
|
||||||
|
[._]sw[a-p]
|
||||||
|
|
||||||
|
# Session
|
||||||
|
Session.vim
|
||||||
|
Sessionx.vim
|
||||||
|
|
||||||
|
# Temporary
|
||||||
|
.netrwhist
|
||||||
|
|
||||||
|
# Auto-generated tag files
|
||||||
|
tags
|
||||||
|
|
||||||
|
# Persistent undo
|
||||||
|
[._]*.un~
|
||||||
|
|
||||||
|
# Coc configuration directory
|
||||||
|
.vim
|
||||||
|
|
||||||
|
# End of https://www.gitignore.io/api/vim,linux,python
|
||||||
|
|
||||||
|
processed
|
@ -0,0 +1,14 @@
|
|||||||
|
[[source]]
|
||||||
|
name = "pypi"
|
||||||
|
url = "https://pypi.org/simple"
|
||||||
|
verify_ssl = true
|
||||||
|
|
||||||
|
[dev-packages]
|
||||||
|
|
||||||
|
[packages]
|
||||||
|
pygame = "*"
|
||||||
|
opencv-contrib-python-headless = "*"
|
||||||
|
pillow = "*"
|
||||||
|
|
||||||
|
[requires]
|
||||||
|
python_version = "3.8"
|
@ -0,0 +1,140 @@
|
|||||||
|
{
|
||||||
|
"_meta": {
|
||||||
|
"hash": {
|
||||||
|
"sha256": "6f09e2773e8887208f2d1d1ce68cee6d8355aff5a6ba38645c2e39e96cb4b15e"
|
||||||
|
},
|
||||||
|
"pipfile-spec": 6,
|
||||||
|
"requires": {
|
||||||
|
"python_version": "3.8"
|
||||||
|
},
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"name": "pypi",
|
||||||
|
"url": "https://pypi.org/simple",
|
||||||
|
"verify_ssl": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"numpy": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:1786a08236f2c92ae0e70423c45e1e62788ed33028f94ca99c4df03f5be6b3c6",
|
||||||
|
"sha256:17aa7a81fe7599a10f2b7d95856dc5cf84a4eefa45bc96123cbbc3ebc568994e",
|
||||||
|
"sha256:20b26aaa5b3da029942cdcce719b363dbe58696ad182aff0e5dcb1687ec946dc",
|
||||||
|
"sha256:2d75908ab3ced4223ccba595b48e538afa5ecc37405923d1fea6906d7c3a50bc",
|
||||||
|
"sha256:39d2c685af15d3ce682c99ce5925cc66efc824652e10990d2462dfe9b8918c6a",
|
||||||
|
"sha256:56bc8ded6fcd9adea90f65377438f9fea8c05fcf7c5ba766bef258d0da1554aa",
|
||||||
|
"sha256:590355aeade1a2eaba17617c19edccb7db8d78760175256e3cf94590a1a964f3",
|
||||||
|
"sha256:70a840a26f4e61defa7bdf811d7498a284ced303dfbc35acb7be12a39b2aa121",
|
||||||
|
"sha256:77c3bfe65d8560487052ad55c6998a04b654c2fbc36d546aef2b2e511e760971",
|
||||||
|
"sha256:9537eecf179f566fd1c160a2e912ca0b8e02d773af0a7a1120ad4f7507cd0d26",
|
||||||
|
"sha256:9acdf933c1fd263c513a2df3dceecea6f3ff4419d80bf238510976bf9bcb26cd",
|
||||||
|
"sha256:ae0975f42ab1f28364dcda3dde3cf6c1ddab3e1d4b2909da0cb0191fa9ca0480",
|
||||||
|
"sha256:b3af02ecc999c8003e538e60c89a2b37646b39b688d4e44d7373e11c2debabec",
|
||||||
|
"sha256:b6ff59cee96b454516e47e7721098e6ceebef435e3e21ac2d6c3b8b02628eb77",
|
||||||
|
"sha256:b765ed3930b92812aa698a455847141869ef755a87e099fddd4ccf9d81fffb57",
|
||||||
|
"sha256:c98c5ffd7d41611407a1103ae11c8b634ad6a43606eca3e2a5a269e5d6e8eb07",
|
||||||
|
"sha256:cf7eb6b1025d3e169989416b1adcd676624c2dbed9e3bcb7137f51bfc8cc2572",
|
||||||
|
"sha256:d92350c22b150c1cae7ebb0ee8b5670cc84848f6359cf6b5d8f86617098a9b73",
|
||||||
|
"sha256:e422c3152921cece8b6a2fb6b0b4d73b6579bd20ae075e7d15143e711f3ca2ca",
|
||||||
|
"sha256:e840f552a509e3380b0f0ec977e8124d0dc34dc0e68289ca28f4d7c1d0d79474",
|
||||||
|
"sha256:f3d0a94ad151870978fb93538e95411c83899c9dc63e6fb65542f769568ecfa5"
|
||||||
|
],
|
||||||
|
"version": "==1.18.1"
|
||||||
|
},
|
||||||
|
"opencv-contrib-python-headless": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:0a4028fcfeeb015d6c9ed42b99bfe47278742ab801864f3e5c7d7fac3cf5f39a",
|
||||||
|
"sha256:26dcc750ab78ed0e42f7cfb08c61d99fb1be406279e3c78a3bbb30a42ec1f5a3",
|
||||||
|
"sha256:2790a1cdd03b2016647836e70918a7b2adcffdfac5602ffd36f8ed1c9fa72510",
|
||||||
|
"sha256:27fb70483c5d557b58f4389b7549f7a52762f504974bccf0da3eab770603b0ca",
|
||||||
|
"sha256:2adfa38368c0247736a135aafcb80d30fe1ba5b661a1016f7e0cdbefae1a22ca",
|
||||||
|
"sha256:39e020d84524e610c5d53de9120054a51013c3c210f55815784e188d252167ca",
|
||||||
|
"sha256:3af42680424f97f71462924073e2378ba266be256bd52e401b77ed282c7e636e",
|
||||||
|
"sha256:3ce51c1a0ed90edf0179a58f337e9c060ac55eaf55cb85563dbe62b33536e6b2",
|
||||||
|
"sha256:43a96845abbd7d02a852c161dad607b6dcdf6af72722c48c3f08ff38d00c7aeb",
|
||||||
|
"sha256:534d1662e8f213c95fb675b9ae8ea3cb5c86a92b5b07daec0f6944a9cc4270e6",
|
||||||
|
"sha256:5b098a6938e8f3a13f29befdd89b0f691c83ac36886efd422dcbc539587a9aaf",
|
||||||
|
"sha256:5c65acf28a111ee38025a4b1dbd33af61ce94c579722fdfe13fc26de853fc670",
|
||||||
|
"sha256:5fe0d5c2e36d4e36ce0e372b2aed232d57483c85ddc7b4435338fe0406d1fad0",
|
||||||
|
"sha256:6b1759e5e6ed459f5bfeb1094e8f7a1fe941b6d53a473c42bd057682fce9c9bd",
|
||||||
|
"sha256:72f5a0166b5404d8972dced9dd336eac53bd1eaf121a39a5ea6dba3f1fce934a",
|
||||||
|
"sha256:7f6df41ff1616c50988bc8df40399acd62b7b16c8b84bae4c42e44be9bcfb6f5",
|
||||||
|
"sha256:81445f65c29a1bd3dced6ecb1158d3ed652cf59c3586de47d5a05bee7327be1a",
|
||||||
|
"sha256:a1db72a542ebc45f25b042a335e50940e5f82ece922d0c37957cf91cf6c0632d",
|
||||||
|
"sha256:a531bb9c3a8900fe8f22a5697ddb5655d4fcee2bfe73516729fab54068c83987",
|
||||||
|
"sha256:b3217143b1f9803a3afdc74353f9ce9e5e304844600d9412544efe4748f46129",
|
||||||
|
"sha256:b65612d35e178c0295d0a1b6e2dca5e30a1823a29d74aaa845ba770e1bfda8dc",
|
||||||
|
"sha256:be0253cf93e1cb99318bc423d4b33789acbe8105b2f004d39bda1076bfff6712",
|
||||||
|
"sha256:c7df23a583fc2b21faa3f083ea3dac66624b6aef2219b14306d6ca477aaa1421",
|
||||||
|
"sha256:c7eebc317a4cc3853d3ca40c732f35e5b74d3083783298f56b6750191770c9c7",
|
||||||
|
"sha256:ca3dcc46b7bdb076ddd87aa5fd611de38d8006c64d34c5fcf6ffc42467e0f341",
|
||||||
|
"sha256:d1cc8200b6ec00b37a6d5b89d2d80b69416bc1894dbda508a6a869fa74e63a20",
|
||||||
|
"sha256:dfcfabb2a5590606b2b1e4270bcde2b0ed32e3d0ecd6c5e56131a2125795ec3e"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"version": "==4.2.0.32"
|
||||||
|
},
|
||||||
|
"pillow": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:0a628977ac2e01ca96aaae247ec2bd38e729631ddf2221b4b715446fd45505be",
|
||||||
|
"sha256:4d9ed9a64095e031435af120d3c910148067087541131e82b3e8db302f4c8946",
|
||||||
|
"sha256:54ebae163e8412aff0b9df1e88adab65788f5f5b58e625dc5c7f51eaf14a6837",
|
||||||
|
"sha256:5bfef0b1cdde9f33881c913af14e43db69815c7e8df429ceda4c70a5e529210f",
|
||||||
|
"sha256:5f3546ceb08089cedb9e8ff7e3f6a7042bb5b37c2a95d392fb027c3e53a2da00",
|
||||||
|
"sha256:5f7ae9126d16194f114435ebb79cc536b5682002a4fa57fa7bb2cbcde65f2f4d",
|
||||||
|
"sha256:62a889aeb0a79e50ecf5af272e9e3c164148f4bd9636cc6bcfa182a52c8b0533",
|
||||||
|
"sha256:7406f5a9b2fd966e79e6abdaf700585a4522e98d6559ce37fc52e5c955fade0a",
|
||||||
|
"sha256:8453f914f4e5a3d828281a6628cf517832abfa13ff50679a4848926dac7c0358",
|
||||||
|
"sha256:87269cc6ce1e3dee11f23fa515e4249ae678dbbe2704598a51cee76c52e19cda",
|
||||||
|
"sha256:875358310ed7abd5320f21dd97351d62de4929b0426cdb1eaa904b64ac36b435",
|
||||||
|
"sha256:8ac6ce7ff3892e5deaab7abaec763538ffd011f74dc1801d93d3c5fc541feee2",
|
||||||
|
"sha256:91b710e3353aea6fc758cdb7136d9bbdcb26b53cefe43e2cba953ac3ee1d3313",
|
||||||
|
"sha256:9d2ba4ed13af381233e2d810ff3bab84ef9f18430a9b336ab69eaf3cd24299ff",
|
||||||
|
"sha256:a62ec5e13e227399be73303ff301f2865bf68657d15ea50b038d25fc41097317",
|
||||||
|
"sha256:ab76e5580b0ed647a8d8d2d2daee170e8e9f8aad225ede314f684e297e3643c2",
|
||||||
|
"sha256:bf4003aa538af3f4205c5fac56eacaa67a6dd81e454ffd9e9f055fff9f1bc614",
|
||||||
|
"sha256:bf598d2e37cf8edb1a2f26ed3fb255191f5232badea4003c16301cb94ac5bdd0",
|
||||||
|
"sha256:c18f70dc27cc5d236f10e7834236aff60aadc71346a5bc1f4f83a4b3abee6386",
|
||||||
|
"sha256:c5ed816632204a2fc9486d784d8e0d0ae754347aba99c811458d69fcdfd2a2f9",
|
||||||
|
"sha256:dc058b7833184970d1248135b8b0ab702e6daa833be14035179f2acb78ff5636",
|
||||||
|
"sha256:ff3797f2f16bf9d17d53257612da84dd0758db33935777149b3334c01ff68865"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"version": "==7.0.0"
|
||||||
|
},
|
||||||
|
"pygame": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:0480fe82cd41a43e3eea497fa2c059c72ac54cb5d003d5aa2ed06a04541c384e",
|
||||||
|
"sha256:136a3b5711d9ec369a0407e4e08ffced3ba61aa41059e9280ffffa79c8614f65",
|
||||||
|
"sha256:2622b9dd95f445c887a36a57eade42c672598589f69a8052ccdb8eeeffa4dbb1",
|
||||||
|
"sha256:301c6428c0880ecd4a9e3951b80e539c33863b6ff356a443db1758de4f297957",
|
||||||
|
"sha256:396320aa29a925feed0b64639f77ce1418722ea7f536b4e4936083dd8d4c4535",
|
||||||
|
"sha256:398c42b605ecc514e62f68f1944a2d21e247938309f598de6cb0ad3c207324a8",
|
||||||
|
"sha256:4aaff572a273a32e70ec3593d213e59ab11c183a9916616562247930f17a5447",
|
||||||
|
"sha256:4e1065577f1b29111113be5deb2ea88553551a5e1cf33e0c08fa32768f285809",
|
||||||
|
"sha256:5f052dc2975a399aa1830c1f04c5f72856aa416bf3cd4b31375a058015a5c620",
|
||||||
|
"sha256:68ea43e51150316b9fb08e251209d4e2b4e76a340b5b6fc8cdf1a898c78f7e5b",
|
||||||
|
"sha256:698433a9fcefca0527244dc44dff9503eb26157494730b1cc80e6e4dbb246e92",
|
||||||
|
"sha256:6f714986f7987f10cb94f1be0753318e341a7ea6b12d66f37a4d5d6dd4695023",
|
||||||
|
"sha256:73cd9df328c7e72638dbcc1d18e7155225faed880a53db6bad90d1d7c0a71dfd",
|
||||||
|
"sha256:7876d1f29f66d3d7cac46479503891ee1ef409b0fbce54b0d74f3a6b33a46dba",
|
||||||
|
"sha256:854e87b8b2b76e3ed11d64985fcfdd7af919659503de99fc2b0a717b314c3cf0",
|
||||||
|
"sha256:8da13704ad45b7d5de8a8cca135a7f44c7fc6aa9f691abe7b0392468a34a8013",
|
||||||
|
"sha256:9ce22fb72298ea33dbb3a1c6c60a4a4e19d9698df6f3f5782eba4dada7b7736d",
|
||||||
|
"sha256:a37b6c59e7b8feadc51db5197052b86ceb6443f9fb2a6f7d6527620e707c558c",
|
||||||
|
"sha256:a6e8d2f99dbe1dfe72d0c019693c14d93c410f702d0b04ec9a81b36dacd55a23",
|
||||||
|
"sha256:a9ac862dd7159861f2c6443b0029089e1c0c4ec762a8074022914ec52fe4dfac",
|
||||||
|
"sha256:ae1bc3e78ed28f20878e7ca2c98663a6634e9c00d7746d39413fc18e907dc162",
|
||||||
|
"sha256:be7e70f91bd4eb35ae081062f16bf434619b3292358d9b061f8159ddc570c7f0",
|
||||||
|
"sha256:c895cf9c1b6d1cbba8cb8cc3f5427febcf8aa41a9333697741abeea1c537a350",
|
||||||
|
"sha256:e3e7e4a09dfd8b03663222d6bcadec9fef021404f4d9eecf56825342e039dfc1",
|
||||||
|
"sha256:f1f5714d2c23f6a64ef2ac4fcd36a2dd2689da85978d951a99a6ae5dfdf9bdbc",
|
||||||
|
"sha256:fa788f775680fc5d268ab00a2da29c9a22830032cfab732730298a2952cd87f3"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"version": "==1.9.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"develop": {}
|
||||||
|
}
|
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 335 KiB |
After Width: | Height: | Size: 182 KiB |
@ -0,0 +1,47 @@
|
|||||||
|
import os, sys, random
|
||||||
|
import argparse
|
||||||
|
from datetime import date
|
||||||
|
from time import strftime
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import cv2
|
||||||
|
from PIL import Image, ImageDraw
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(description='Process an image uploaded to the server.')
|
||||||
|
parser.add_argument('filename', action='store',
|
||||||
|
help='Filename of photo to process')
|
||||||
|
parser.add_argument('city', action='store',
|
||||||
|
help='City of the visitor')
|
||||||
|
parser.add_argument('school', action='store',
|
||||||
|
help='School of the visitor')
|
||||||
|
parser.add_argument('age', action='store',
|
||||||
|
help='Age of the visitor')
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
image = cv2.imread(args.filename)
|
||||||
|
image_gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
|
||||||
|
face_cascade = cv2.CascadeClassifier("./data/haarcascade_frontalface_default.xml")
|
||||||
|
faces = face_cascade.detectMultiScale(image_gray)
|
||||||
|
|
||||||
|
if (len(faces) != 1):
|
||||||
|
print(f"Error: {len(faces)} faces detected in the image.")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
im = Image.open(args.filename)
|
||||||
|
draw = ImageDraw.Draw(im)
|
||||||
|
|
||||||
|
randomFile = random.choice(os.listdir("./data/circles"))
|
||||||
|
circle = Image.open(f"./data/circles/{randomFile}")
|
||||||
|
|
||||||
|
for x, y, width, height in faces:
|
||||||
|
circle = circle.resize((width * 2, height * 2), Image.ANTIALIAS)
|
||||||
|
im.paste(circle, (x - width // 2, y - height // 2 ), circle)
|
||||||
|
|
||||||
|
date = date.today()
|
||||||
|
time = strftime("%H-%M-%S")
|
||||||
|
|
||||||
|
Path(f"./processed/{date}/").mkdir(parents=True,exist_ok=True)
|
||||||
|
im.save(f"./processed/{date}/{time}.jpg")
|
||||||
|
|
||||||
|
sys.exit(0);
|