elyha7 / yoloface Goto Github PK
View Code? Open in Web Editor NEWYolov5 Face Detection
License: GNU General Public License v3.0
Yolov5 Face Detection
License: GNU General Public License v3.0
yoloface/utils/preprocess_utils.py
Lines 8 to 13 in 04bfe34
Where did you find these coordinates?
thank you
Can't get attribute 'SPPF' on <module 'models.common' from
when model = torch.load('yolov5m.pt', map_location='cpu')['model']
Hi,
I can not use your Repo for inference.
I have 'cloned' your repo, 'cd' to it, then installed dependencies which has been mentioned in 'requirements.txt'
and then used
from yoloface import YoloDetector
import numpy as np
from PIL import Image
model = YoloFace(target_size=720,gpu=0,min_face=90)
orgimg = np.array(Image.open('test_image.jpg'))
bboxes,points = model.predict(orgimg)
But it returns that yoloface is not installed!
ImportError Traceback (most recent call last)
in ()
----> 1 from yoloface import YoloDetector
2 import numpy as np
3 from PIL import Image
4
5 model = YoloFace(target_size=720,gpu=0,min_face=90)/content/yoloface/yoloface.py in ()
11 from math import sqrt
12
---> 13 from .models.common import Conv
14 from .models.yolo import Model
15 from .utils.datasets import letterboxImportError: attempted relative import with no known parent package
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
How should i fix this?
Thanks
Best regards
Line 14 in 04bfe34
I think this needs to be
sys.path.append(os.path.abspath(os.path.dirname(__file__)))
instead of
sys.path.append(os.path.abspath(os.path.join(os.path.dirname("__file__"), '..')))
In README you use as an example YoloDetector(target_size=720,gpu=0,min_face=90)
. But YoloDetector
has no parameter gpu
, i guess it should be device
Where can I find weight for different models? yolov5n-face, yolov5s-face, yolov5m-face and so on?
Has anyone compared SCRFD to YOLO for face detection? Which one is better or more performant?
How do I choose a model?
I am trying to use your face detector script to get the bboxes on several images but it does not work how it is expected. First of all, your README describes that you can pass several images packed in a list to get multi-image predictions with the following example:
bboxes,points = model.predict([image1,image2])
but does not mention if the image1 and image2 are the paths to that images or the object you get after you open them with PIL (for example: Image.open('image1'), assuming they have the same root directory). I get the following errors in this cases:
Traceback (most recent call last):
File "C:\YOLOv5\yoloface\detect.py", line 65, in
_main(arguments)
File "C:\YOLOv5\yoloface\detect.py", line 58, in _main
bboxes, points = model.predict(orgimg)
File "C:\YOLOv5\yoloface\face_detector.py", line 159, in predict
images = self._preprocess(images)
File "C:\YOLOv5\yoloface\face_detector.py", line 73, in _preprocess
h0, w0 = img.shape[:2] # orig hw
ValueError: not enough values to unpack (expected 2, got 1)
from this call: orgimg = np.array([Image.open('00000002.png'), Image.open('00000001.png')]) bboxes, points = model.predict(orgimg)
(when I pass the images as PIL objects)
Traceback (most recent call last):
File "C:\YOLOv5\yoloface\detect.py", line 65, in
_main(arguments)
File "C:\YOLOv5\yoloface\detect.py", line 58, in _main
bboxes, points = model.predict(orgimg)
File "C:\YOLOv5\yoloface\face_detector.py", line 159, in predict
images = self._preprocess(images)
File "C:\YOLOv5\yoloface\face_detector.py", line 73, in _preprocess
h0, w0 = img.shape[:2] # orig hw
ValueError: not enough values to unpack (expected 2, got 1)
from this call: orgimg = np.array(['00000002.png', '00000001.png']) bboxes, points = model.predict(orgimg)
(where I pass the images as paths to them)
Traceback (most recent call last):
File "C:\YOLOv5\yoloface\detect.py", line 65, in
_main(arguments)
File "C:\YOLOv5\yoloface\detect.py", line 58, in _main
bboxes, points = model.predict(['00000002.png', '00000001.png'])
File "C:\YOLOv5\yoloface\face_detector.py", line 159, in predict
images = self._preprocess(images)
File "C:\YOLOv5\yoloface\face_detector.py", line 73, in _preprocess
h0, w0 = img.shape[:2] # orig hw
AttributeError: 'str' object has no attribute 'shape'
from this call: bboxes, points = model.predict(['00000002.png', '00000001.png'])
(where I pass the images as paths to them)
and
Traceback (most recent call last):
File "C:\YOLOv5\yoloface\detect.py", line 65, in
_main(arguments)
File "C:\YOLOv5\yoloface\detect.py", line 58, in _main
bboxes, points = model.predict([Image.open('00000002.png'), Image.open('00000001.png')])
File "C:\YOLOv5\yoloface\face_detector.py", line 159, in predict
images = self._preprocess(images)
File "C:\YOLOv5\yoloface\face_detector.py", line 73, in _preprocess
h0, w0 = img.shape[:2] # orig hw
File "C:\Users\rtanase\Anaconda3\envs\detect\lib\site-packages\PIL\Image.py", line 519, in getattr
raise AttributeError(name)
AttributeError: shape
from this call: bboxes, points = model.predict([Image.open('00000002.png'), Image.open('00000001.png')])
(when I pass the images as PIL objects)
Hi!
Firstly, thank you so much for such a convenient wrapper, you saved a lot of time, thank you again!
When trying to "drive away" a vertical photo, unfortunately I encounter an error
RuntimeError: Given groups=1, weight of size [32, 3, 3, 3], expected input[1, 4, 608, 608] to have 3 channels, but got 4 channels instead
I will be glad to help, thanks a lot in advance!
Have a nice day :D
Hello,
Is there any support for training / fine-tune weights on personal datasets? Or I should use the train script from the deepcam repository? Thank you in advance.
Hello, mate @elyha7 .
I'm trying to convert face detector to onnx via your "export.py" file and have some issue:
after convertion output sizes don't fit with output sizes from loaded model ("model = YoloDetector( ... )")
Is it ok? And I'm confused, which postprocessing I need to do with these outputs? Any ideas?
P.S. thx a lot for your repo))
Hello!
In source code there is mentioned anti profile model to determine, whether a face is frontal or not
Line 37 in 4c92a01
But there is no such file in models
folder, nor the mentioning about that in readme
Can you please tell me, what is it and where could it be found?
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.