acnazarejr / fdet Goto Github PK
View Code? Open in Web Editor NEWAn easy to use face detection module based on MTCNN and RetinaFace algorithms.
License: MIT License
An easy to use face detection module based on MTCNN and RetinaFace algorithms.
License: MIT License
RESNET50 and MOBILENET model files at drop box are not found
testing below:
import cv2
from fdet import io, RetinaFace
BATCH_SIZE = 1000
detector = RetinaFace(backbone='MOBILENET', cuda_devices=[0,1,2,3])
vid_cap = cv2.VideoCapture('13.mp4')
video_face_detections = [] # list to store all video face detections
image_buffer = [] # buffer to store the batch
while True:
success, frame = vid_cap.read() # read the frame from video capture
if not success:
break # end of video
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) # convert to RGB
image_buffer.append(frame) # add frame to buffer
if len(image_buffer) == BATCH_SIZE: # if buffer is full, detect the batch
batch_detections = detector.batch_detect(image_buffer)
video_face_detections.extend(batch_detections)
image_buffer.clear() # clear the buffer
if image_buffer: # checks if images remain in the buffer and detect it
batch_detections = detector.batch_detect(image_buffer)
video_face_detections.extend(batch_detections)
generate the result:
Downloading: "https://www.dropbox.com/s/kr1xjmzry4l8p6g/retinaface_mobilenetv1_final.pt?dl=1" to C:\Users\DFMRendering/.cache\torch\checkpoints\retinaface_mobilenetv1_final.pt
raise HTTPError(req.full_url, code, msg, hdrs, fp)
HTTPError: Not Found
def _load_mobile_net_model(self):
model = _MobileNetV1()
state_dict = load_state_dict_from_url(
'https://www.dropbox.com/s/bd1keyo085pscfu/mobilenetv1_pretrain.pt?dl=1',
map_location=self._device_control
)
# # load params
model.load_state_dict(state_dict)
return model``
this dropbox link for mobile net is not working
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.