Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33,314 changes: 33,314 additions & 0 deletions MachineLearning Projects/Face-detecting/Cascade-Files/face_default.xml

Large diffs are not rendered by default.

35,712 changes: 35,712 additions & 0 deletions MachineLearning Projects/Face-detecting/Cascade-Files/more_bet.xml

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions MachineLearning Projects/Face-detecting/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Detecting face from photo or camera
___
### Setup
`pip install -r requirements.txt`

___
### Usage
`python3 main.py` detecting face from camera
`q` for exit from frame


`pyhton3 detect_face_from_image` detecting face from images on
directory images `q` for exit from frame
20 changes: 20 additions & 0 deletions MachineLearning Projects/Face-detecting/detect_face_from_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import cv2

img = cv2.imread('images/im1.jpg')
img2 = cv2.imread('images/im2.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
gray2 = cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY)

window_name = 'Image'

faces = cv2.CascadeClassifier('Cascade-Files/more_bet.xml')

results = faces.detectMultiScale(gray, 1.1, 4)
# results = faces.detectMultiScale(gray2, 1.1, 4)

for (x, y, w, h) in results:
cv2.rectangle(img, (x, y), (x + w, y + h), (0, 0, 255), 2)
cv2.rectangle(img2, (x, y), (x + w, y + h), (0, 0, 255), 2)

cv2.imshow(window_name, img)
cv2.waitKey(0)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions MachineLearning Projects/Face-detecting/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# обнаруживает пока что только лицо и пишет на рамочке

import cv2

video = cv2.VideoCapture(0)
hands_hear_cascade = cv2.CascadeClassifier('Cascade-Files/more_bet.xml')

# Write some Text

font = cv2.FONT_ITALIC
text = 'Face detected'
fontScale = 1
fontColor = (0, 255, 0)
thickness = 3
lineType = 1

while True:
_r, frame = video.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
hands = hands_hear_cascade.detectMultiScale(gray, 1.1, 3)

if len(hands):
print("Face")

for x, y, w, h in hands:
bottomLeftCornerOfText = (x - 5, y - 5)
cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)
cv2.putText(frame, text,
bottomLeftCornerOfText,
font,
fontScale,
fontColor,
thickness,
lineType)
cv2.imshow("test", frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
video.release()
cv2.destroyAllWindows()
2 changes: 2 additions & 0 deletions MachineLearning Projects/Face-detecting/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
numpy==1.23.4
opencv-python==4.6.0.66
31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,29 @@
### Description

Welcome aboard fellow developer, this is where you will find Python scripts which you are free to contribute to.
You can contribute by submitting your own scripts, also written in Python, which you think would be amazing for other people to see.
You can contribute by submitting your own scripts, also written in Python, which you think would be amazing for other
people to see.

### Contribution Guidelines

The contribution guidelines are as per the guide [HERE](https://github.com/larymak/Python-project-Scripts/blob/main/CONTRIBUTING.md).
The contribution guidelines are as per the
guide [HERE](https://github.com/larymak/Python-project-Scripts/blob/main/CONTRIBUTING.md).

### Instructions

- Fork this repository
- Clone your forked repository
- Add your scripts
- Commit and push
- Create a pull request
- Star this repository
- Wait for pull request to merge
- Celebrate your first step into the open source world and contribute more
- Fork this repository
- Clone your forked repository
- Add your scripts
- Commit and push
- Create a pull request
- Star this repository
- Wait for pull request to merge
- Celebrate your first step into the open source world and contribute more

## Additional tools to help you get Started with Open-Source Contribution

- [How to Contribute to Open Source Projects – A Beginner's Guide](https://www.freecodecamp.org/news/how-to-contribute-to-open-source-projects-beginners-guide/)
- [How to Write a Good README File for Your GitHub Project](https://www.freecodecamp.org/news/how-to-write-a-good-readme-file/)
- [How to Contribute to Open Source Projects – A Beginner's Guide](https://www.freecodecamp.org/news/how-to-contribute-to-open-source-projects-beginners-guide/)
- [How to Write a Good README File for Your GitHub Project](https://www.freecodecamp.org/news/how-to-write-a-good-readme-file/)

---

Expand All @@ -46,7 +48,7 @@ The contribution guidelines are as per the guide [HERE](https://github.com/larym
## Projects

| SR No | Project | Author |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------|
| 1 | [Ascii Image Converter](https://github.com/larymak/Python-project-Scripts/tree/main/ART%20SCRIPTS/image-ascii) | [Lary Mak](https://github.com/larymak) |
| 2 | [DigitalClock](https://github.com/larymak/Python-project-Scripts/tree/main/TIME%20SCRIPTS/DigitalClock) | [Logan Ozdyck](https://github.com/ozdyck3) |
| 3 | [Insta Spam Bot](https://github.com/larymak/Python-project-Scripts/tree/main/BOTS/InstaSpamBot) | [Lary Mak](https://github.com/larymak) |
Expand Down Expand Up @@ -112,4 +114,5 @@ The contribution guidelines are as per the guide [HERE](https://github.com/larym
| 63 | [QtQuiz](https://github.com/larymak/Python-project-Scripts/tree/main/GUI/QtQuiz) | [Eduardo C.](https://github.com/ehcelino) |
| 64 | [Umbrella Reminder](https://github.com/larymak/Python-project-Scripts/tree/main/AUTOMATION/Umbrella%20Reminder) | [Edula Vinay Kumar Reddy](https://github.com/vinayedula) |
| 65 | [Image to PDF](https://github.com/larymak/Python-project-Scripts/tree/main/IMAGES%20%26%20PHOTO%20SCRIPTS/Image%20to%20PDF) | [Vedant Chainani](https://github.com/Envoy-VC) |
| 66 | [KeyLogger](https://github.com/larymak/Python-project-Scripts/tree/main/OTHERS/KeyLogger) | [Akhil](https://github.com/akhil-chagarlamudi) |
| 66 | [KeyLogger](https://github.com/larymak/Python-project-Scripts/tree/main/OTHERS/KeyLogger) | [Akhil](https://github.com/akhil-chagarlamudi) |
| 67 | [Face-detecting](https://github.com/azamtoiri/Python-project-Scripts/tree/main/MachineLearning%20Projects/Face-detecting) | [Azam Toiri](https://github.com/azamtoiri) |