
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Snappy2 makes it easy to draw fun overlays on images. It uses a neural network to detect face keypoints and then uses those key points to draw overlays such as glasses, mustaches, hats, ears, and custom overlays on the face. The library is easy to use and comes with several code examples to get started quickly with a variety of drawing options:
Click here for live snappy2 demo.
from snappy2 import Snappy2
snappy = Snappy2()
human_image = snappy.load_image('<file_path>')
snappy.set_mustache(human_image, mus_index=0)
snappy = Snappy2()
human_image = snappy.load_image('<file_path>')
snappy.set_glasses(human_image, gls_index=0)
snappy = Snappy2()
human_image = snappy.load_image('<file_path>')
snappy.set_ears(human_image, gls_index=0)
snappy = Snappy2()
human_image = snappy.load_image('<file_path>')
# parameters: path, text, text size, drawing location.
snappy.set_text(human_image, 'Snappy2', 60, v_position='bottom')
human_image.show()
Github code available here.
For more examples check the (Demo.py).
This library utilizes photos that are freely accessible on the web. If any of the example photos have licensing restrictions, please reach out to the library owner directly for clarification or removal.
The MIT License (MIT)
Copyright (c) 2017 Ahmad Barqawi (github.com/Barqawiz)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
FAQs
Detect faces and draw overlay images
We found that snappy2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.