Skip to content

Commit

Permalink
updating readme. updating car detection file.
Browse files Browse the repository at this point in the history
  • Loading branch information
bk521234 committed Jul 11, 2019
1 parent a9b99ca commit 31b02b8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# ml
ml

# Repo Components
## Computer Vision
TRAIN YOUR OWN OPENCV HAAR CLASSIFIER - https://coding-robin.de/2013/07/22/train-your-own-opencv-haar-classifier.html

## Natural Language Processing

## Time Series Analysis

## General Data Analysis

# Learning Resources
https://machinelearningmastery.com/start-here/#getstarted
Expand Down
14 changes: 8 additions & 6 deletions cv/car_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,31 @@

# capture frames from a video
cap = cv2.VideoCapture(os.path.join( FILE_DIR, 'video.avi'))

#cap = cv2.VideoCapture(os.path.join( FILE_DIR, "Dash-Cam Videos That'll Make You Say - WTF!-0SXAkpxF6_k.mp4"))


# Trained XML classifiers describes some features of some object we want to detect
car_cascade = cv2.CascadeClassifier(os.path.join( FILE_DIR, 'cars.xml'))

# loop runs if capturing has been initialized.
while True:
# reads frames from a video
ret, frames = cap.read()

# convert to gray scale of each frames
gray = cv2.cvtColor(frames, cv2.COLOR_BGR2GRAY)


# Detects cars of different sizes in the input image
cars = car_cascade.detectMultiScale(gray, 1.1, 1)

# To draw a rectangle in each cars
for (x,y,w,h) in cars:
cv2.rectangle(frames,(x,y),(x+w,y+h),(0,0,255),2)

# Display frames in a window
cv2.imshow('video2', frames)

# Wait for Esc key to stop
if cv2.waitKey(33) == 27:
break
Expand Down
4 changes: 2 additions & 2 deletions cv/python_background_subtraction.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Python code for Background subtraction using OpenCV
import numpy as np
import cv2
cap = cv2.VideoCapture('/home/username/Downloads/people-walking.mp4')

cap = cv2.VideoCapture('Two people walk up to home, walk away after seeing security camera-bFrwLUjXcLs.mp4')
fgbg = cv2.createBackgroundSubtractorMOG2()

while(1):
Expand Down

0 comments on commit 31b02b8

Please sign in to comment.