├── .idea
├── .gitignore
├── misc.xml
├── inspectionProfiles
│ ├── profiles_settings.xml
│ └── Project_Default.xml
├── modules.xml
└── Cat-Detection-Opencv.iml
├── CD_t1.jpg
├── CD_t2.jpg
├── CD_t3.jpg
├── CD_t5.jpg
├── cat_det.py
└── README.md
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/CD_t1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Spidy20/Cat-Detection-Opencv/HEAD/CD_t1.jpg
--------------------------------------------------------------------------------
/CD_t2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Spidy20/Cat-Detection-Opencv/HEAD/CD_t2.jpg
--------------------------------------------------------------------------------
/CD_t3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Spidy20/Cat-Detection-Opencv/HEAD/CD_t3.jpg
--------------------------------------------------------------------------------
/CD_t5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Spidy20/Cat-Detection-Opencv/HEAD/CD_t5.jpg
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/Cat-Detection-Opencv.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/cat_det.py:
--------------------------------------------------------------------------------
1 | import cv2
2 |
3 | # Initializing a haar cascade
4 | face_cascade = cv2.CascadeClassifier('cat.xml')
5 |
6 | # reads frames from a image
7 | img = cv2.imread("./test_images/t3.jpg")
8 |
9 | # convert to gray scale of each frames
10 | gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
11 |
12 | # Detects faces of different sizes in the input image
13 | faces = face_cascade.detectMultiScale(gray, scaleFactor=1.3,
14 | minNeighbors=10, minSize=(75, 75))
15 |
16 | for (x, y, w, h) in faces:
17 | # To draw a rectangle in a face
18 | cv2.rectangle(img, (x, y), (x + w, y + h), (0,0,255), 3)
19 | cv2.rectangle(img, (x, y - 40), (x + w, y), (0,0,255), -1)
20 | cv2.putText(img, "Cat", (x, y - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2)
21 |
22 | # Display an image in a window
23 | cv2.imshow('img', img)
24 | cv2.waitKey(0)
25 | cv2.destroyAllWindows()
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Cat😺 Face Detection using OpenCV
2 |
3 | [](https://www.python.org/)
4 | [](https://www.python.org/downloads/release/python-360/)
5 |
6 | ## [Follow us on Instagram for Machine Learning Guidelines & Path](https://www.instagram.com/machine_learning_hub.ai/)
7 | ## [Watch Tutorial Videos of these all projects](https://www.youtube.com/c/MachineLearningHub)
8 | ## [Buy Python & ML projects for students at lower rate](https://www.instamojo.com/kushalbhavsar1820)
9 |
10 | ## Usage:-
11 |
12 | - Clone my repository.
13 | - Open CMD in working directory.
14 | - Run `cat_det.py`.
15 |
16 | ## Screenshots
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | ## Just follow☝️ me and Star⭐ my repository
25 |
26 | # [Buy me a Coffee☕](https://www.buymeacoffee.com/spidy20)
27 | ## [Donate me on PayPal(It will inspire me to do more projects)](https://www.paypal.me/spidy1820)
28 | ## Donate me on GPAY:- kushalbhavsar58-1@okaxis
29 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
20 |
21 |
47 |
48 |
49 |
--------------------------------------------------------------------------------