GithubHelp home page GithubHelp logo

c2-week06's Introduction

C2-Week06

Cat Face Detection and Cutting

This program detects and cuts the faces of cats in images using OpenCV. It uses the haarcascade_frontalcatface_extended.xml file for the Cascade Classifier and cat_test_7.jpg file for testing purposes.

Installation

To run this program, the following libraries should be installed:
math, os, cv2

Usage

To run the program, execute the load() function in the Python interpreter or run the program in a Python IDE. The program will ask for the breed of the cats that you want to detect and cut. The images should be located in the datasets/<breed>/original folder. The program will then create a new folder called datasets/<breed>/faces to save the cut faces.

Functions

detect(filename) This function takes a filename as input and detects the cat's face in the image. It returns the coordinates of the cat's face if it is detected, otherwise it returns None.

cut(filename) This function takes a filename as input and uses the detect() function to get the coordinates of the cat's face. It then cuts the cat's face out of the image and returns it. If the face is not detected, it returns None.

load() This function prompts the user for the breed of cats they want to detect and cut. It then searches for images of that breed in the datasets/<breed>/original folder, detects and cuts the cat's face, and saves the cut face in the datasets/<breed>/faces folder. If the face is not detected, it will log a error. The function prints the success rate of face detection and cutting.

c2-week06's People

Contributors

pannic17 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.