From f328ae0dc3c07d3703182e7680fd89de49ec50fc Mon Sep 17 00:00:00 2001 From: Ali Ahmad <57293126+Ali-Jakhar@users.noreply.github.com> Date: Tue, 12 Jan 2021 18:56:53 +0500 Subject: [PATCH] final changes --- README.md | 2 -- hello.txt | 1 - .../Outputfile.jpg | Bin .../file.mp4 | Bin .../file2.mp4 | Bin .../filename.avi | Bin .../people.jpg | Bin mtcnn_image.py | 6 +++--- mtcnn_live_cam.py | 4 ++-- mtcnn_video.py | 16 ++++------------ ~$README.md | Bin 162 -> 0 bytes 11 files changed, 9 insertions(+), 20 deletions(-) delete mode 100644 README.md delete mode 100644 hello.txt rename {input & output images => input & output}/Outputfile.jpg (100%) rename {input & output images => input & output}/file.mp4 (100%) rename {input & output images => input & output}/file2.mp4 (100%) rename {input & output images => input & output}/filename.avi (100%) rename {input & output images => input & output}/people.jpg (100%) delete mode 100644 ~$README.md diff --git a/README.md b/README.md deleted file mode 100644 index ea0f99a..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Face-detection-using-MTCNN -face detection using mtcnn complete implementation step by step diff --git a/hello.txt b/hello.txt deleted file mode 100644 index 95d09f2..0000000 --- a/hello.txt +++ /dev/null @@ -1 +0,0 @@ -hello world \ No newline at end of file diff --git a/input & output images/Outputfile.jpg b/input & output/Outputfile.jpg similarity index 100% rename from input & output images/Outputfile.jpg rename to input & output/Outputfile.jpg diff --git a/input & output images/file.mp4 b/input & output/file.mp4 similarity index 100% rename from input & output images/file.mp4 rename to input & output/file.mp4 diff --git a/input & output images/file2.mp4 b/input & output/file2.mp4 similarity index 100% rename from input & output images/file2.mp4 rename to input & output/file2.mp4 diff --git a/input & output images/filename.avi b/input & output/filename.avi similarity index 100% rename from input & output images/filename.avi rename to input & output/filename.avi diff --git a/input & output images/people.jpg b/input & output/people.jpg similarity index 100% rename from input & output images/people.jpg rename to input & output/people.jpg diff --git a/mtcnn_image.py b/mtcnn_image.py index be7e2cc..5b77de9 100644 --- a/mtcnn_image.py +++ b/mtcnn_image.py @@ -2,7 +2,7 @@ from mtcnn.mtcnn import MTCNN detector = MTCNN() -img=cv2.imread("input & output images/people.jpg") +img=cv2.imread("input & output/people.jpg") location = detector.detect_faces(img) if len(location) > 0: for face in location: @@ -10,5 +10,5 @@ x2, y2 = x + width, y + height cv2.rectangle(img, (x, y), (x2, y2), (0, 0, 255), 4) -cv2.imwrite("input & output images/Outputfile.jpg",img) -print("The Image was successfully saved") \ No newline at end of file +cv2.imwrite("input & output/Outputfile.jpg",img) +print("The Image was successfully saved") diff --git a/mtcnn_live_cam.py b/mtcnn_live_cam.py index 6aaddda..1756426 100644 --- a/mtcnn_live_cam.py +++ b/mtcnn_live_cam.py @@ -2,7 +2,7 @@ from mtcnn.mtcnn import MTCNN detector = MTCNN() -video = cv2.VideoCapture(0) +video = cv2.VideoCapture(0) #Read from computer or external camera if (video.isOpened() == False): print("Web Camera not detected") @@ -22,4 +22,4 @@ break video.release() -cv2.destroyAllWindows() \ No newline at end of file +cv2.destroyAllWindows() diff --git a/mtcnn_video.py b/mtcnn_video.py index 4572c47..9f1b39a 100644 --- a/mtcnn_video.py +++ b/mtcnn_video.py @@ -1,13 +1,10 @@ import cv2 from mtcnn.mtcnn import MTCNN detector = MTCNN() +video = cv2.VideoCapture("input & output/file2.mp4") -video = cv2.VideoCapture("input & output images/file2.mp4") - -# We need to check if camera -# is opened previously or not if (video.isOpened() == False): - print("Error reading video file") + print("Video Not Founds") # We need to set resolutions. # so, convert them from float to integer. @@ -16,10 +13,7 @@ size = (frame_width, frame_height) -# Below VideoWriter object will create -# a frame of above defined The output -# is stored in 'filename.avi' file. -result = cv2.VideoWriter('filename.avi',cv2.VideoWriter_fourcc(*'MJPG'),29, size) +result = cv2.VideoWriter('input & output/filename.avi',cv2.VideoWriter_fourcc(*'MJPG'),29, size) frame_num=0 while (True): ret, frame = video.read() @@ -33,11 +27,9 @@ x, y, width, height = face['box'] x2, y2 = x + width, y + height cv2.rectangle(frame, (x, y), (x2, y2), (0, 0, 255), 4) - result.write(frame) + result.write(frame) #Write an image if cv2.waitKey(1) & 0xFF == ord('q'): break - - # Break the loop else: break diff --git a/~$README.md b/~$README.md deleted file mode 100644 index 6ac0f6f0938a0669ecd2be22b688401a72f300b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmd;b%*j;nO3cnkEMg!Ya4|SC%}!j*^uCsnY$PmY--B3-v;ub(hO0ZDy#qua2#6z