- Copyright : Azmine Toushik Wasi
- Owner : Azmine Toushik Wasi
- Working Principle:
- It first loads the image.
- Detects face using OpenCV.
- Adjusts the face with some free space, crops it and saves it in
./auto_crooped/
. - Loads the template, places everything accordingly.
- Saves as both image and pdf file.
The working example is demonstracted using 10 Minute School ID Card template.
Name | id | Designation |
---|---|---|
Azmine Toushik Wasi | 03.png | Project Executive |
Leonardo Dcaprio | 02.jpeg | Project Manager |
Lal Singh Chadda | 01.png | Project Executive |
Do not use without permission.
- Collect dataset file as
Database.xlsx
- collect images and put them in
./images/
- Set database and column information
form = pd.read_excel("Database.xlsx")
name_list = form['Name'].to_list()
id_list=form['id'].to_list()
designation_list=form['Designation'].to_list()
total = len(name_list)
- Collect fonts and put them in
./font/
, and set font locations.
font = ImageFont.truetype("./font/Poppins-Medium.ttf", 38)
font2 = ImageFont.truetype("./font/Poppins-Regular.ttf", 24)
- Load base image
im = Image.open("0BaseFrame.png")
- Set heights and positions of texts.
MAX_H2,MAX_W2 = 1004,651
current_h2, pad2 = 270, 5
- Change image pasting location if necessary.
saveimg.paste(person_nBG, (0,353),person_nBG)
- Run
main.py
.
Do not use without permission.
Developed by Azmine Toushik Wasi
Machine Learning Researcher | Exploring Machine Learning & Data Science | Kaggle Notebooks Grandmaster | Tech Writer | Reader
- Linkedin : https://www.linkedin.com/in/azminewasi/
- GitHub: https://github.com/azminewasi
Do not use without permission.