Coder Social home page Coder Social logo

any's Introduction

ANY

ANY (niAei visioN librarY) is a small library using mediapipe and opencv to manage detection.

It can handle Face and Hand detection. It consists of two parts.

  • Source
  • Detector

Source

Source is referred to collection of objects such as Camera or Image. This kind of objects can be expended only must for a Source object is that the image data must be stored in source.data. So other objects can read image data and do operations.

  • Image
  • Camera

Image

Image can read data from disk and stores the data in self.data.

from any import Image

image = Image(r"wll-asl.jpg")
image.show()

Camera

Simular to Image, Camera stores the data in self.data, the difference is that Camera will read from a device and not disk.

from any import Camera

camera = Camera(0)
camera.start()
camera.toggle_show()

Detector

Detector is referred to collection of objects such as Hand or Face. This kind of objects can be expended only must for a Detector object is that it must contain a detect method. This method must return pandas DataFrame.

  • Hand
  • Face
  • Pose

Hand

The Hand class uses mediapipe and can detect hands on a source.

from any import Image, Hand

image = Image(r"wll-asl.jpg")
hand = Hand(image)
image.draw_pints = hand.detect()
image.show()

Here we can see the hand detector was executed on an Image source.

Hand

Face

The Face class uses mediapipe and can detect faces on a source.

from any import Camera, Face

camera = Camera(0)
camera.start()
camera.toggle_show()
face = Face(camera)
while True:
    camera.draw_box = face.detect()

Here we can see the face detector was executed on a Camera source.

Face

Pose

The Pose class uses mediapipe and can detect poses on a source.

from any import Image, Pose

image = Image(r"body.png")
pose = Pose(image)
image.draw_pints = pose.detect()
image.show()

Here we can see the body detector was executed on a Image source.

Body

SelfieSegmentation

The SelfieSegmentation class uses mediapipe and can detect person and return a mask. One can use the mask to replace background.

from any import Camera, Image, SelfieSegmentation

camera = Camera(0)
camera.start()
camera.toggle_show()
i = Image("bg.jpg")
ss = SelfieSegmentation(camera, i)
while True:
    camera.replace = ss.detect()

Here we can see the SelfieSegmentation was executed on a Camera source and background was replaced by an Image.

SelfieSegmentation

Getting Any

Any is open source and can be used as GPL-3.0 license allows

Download

Any can be downloaded as:

git clone https://github.com/mshemuni/ANY.git

cd ANY

Installation

Any has requirements such as:

  • mediapipe==0.8.11
  • opencv_python==4.6.0.66
  • pandas==1.4.4
  • numpy~=1.23.3

To install:

pip install mediapipe==0.8.11 opencv_python==4.6.0.66 pandas==1.4.4 numpy~=1.23.3

or

pip install -r requirements.txt

Usage

Run the main.py to see the results.

python main.py

Author

Mohammad S.Niaei

[email protected]

any's People

Contributors

mshemuni avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.