Add a cow mask to the face
Project description
Cow Face
Add a cow mask to the face using OpenCV and Python.
Description
Cow Face
is a Python package that allows you to overlay an animal mask onto a face in an image. It uses OpenCV for image processing.
Installation
To install the package, you can use the following command:
pip install git+pip install git+https://github.com/SinaHosseini/Cow-Face
or
pip install cow-face
Usage
Here's an example of how to use the package:
import cow_face
import cv2
# Define the paths to the images
image_path = "path/to/your/image.jpg"
cow_path = "input/cow.jpg"
# Read the images
my_image = cv2.imread(image_path)
image_cow = cv2.imread(cow_path)
# Resize images if needed
my_image = cv2.resize(my_image, [640, 640])
image_cow = cv2.resize(image_cow, [640, 640])
# Apply the mask
image_cow_ghost, image_cow_transparent = cow_face.transparent_sticker(image_cow)
convert_image = my_image * image_cow_ghost + image_cow_transparent
# Save the result
cv2.imwrite("output/animal_face.jpg", convert_image)
You can also run the script directly from the command line:
python cow_face.py --image_path path/to/your/image.jpg
Requirements
Python 3.6+
OpenCV
NumPy
Author
Sina Hosseini
Email: sshosseinivaez@gmail.com
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cow_face-1.0.1.tar.gz
(2.4 kB
view details)
Built Distribution
File details
Details for the file cow_face-1.0.1.tar.gz
.
File metadata
- Download URL: cow_face-1.0.1.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28f04c6e922fb26a87e124b255907fa68a0ec3eb5f62c9519777554edeecba80 |
|
MD5 | 9a7f31099e93f48f2b0ba3f7bb297004 |
|
BLAKE2b-256 | cb1db6b74c904bb34bf9c837f7486ae9f709df5463eb5e0ce04d11718b57cb77 |
File details
Details for the file cow_face-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: cow_face-1.0.1-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79d2e63a707ae5c24127ffb1b219b686d47268893b8e0e25d19fdb7eb4718780 |
|
MD5 | 7c2072e1609f82368404b6f1184ae3da |
|
BLAKE2b-256 | 4f5baad54074ffae3ac3b5182fe1838cc0a7851bdb855adc9bf526efd3725e15 |