Giter VIP home page Giter VIP logo

Comments (13)

AndreKev avatar AndreKev commented on August 26, 2024 1

i got an issue unpacking box.

This is how I fixed this

for box,lm in zip(bboxes,points):
    for x1,y1,x2,y2 in box :
        count += 1
        orgimg = cv2.rectangle(orgimg,(x1,y1),(x2,y2),(255,0,0),3)
        for i in lm:
            x = i[0][0]
            y = i[0][1]
            #orgimg = cv2.circle(orgimg, (x, y), 3, (0,255,0), 1)

I get an issue drawing the circle. x and y are not numbers but lists.

What do they represent ?

from yoloface.

elyha7 avatar elyha7 commented on August 26, 2024

Changed repo's structure to use absolute imports, now your problem must be solved. If you want to import module outside the repo's folder, export path into PYTHONPATH (example in readme).

from yoloface.

ModynAI avatar ModynAI commented on August 26, 2024

Thanks
Its fixed Now. but i dont have output image

its just says that

0
/content/yoloface/weights/yolov5n_state_dict.pt
WARNING: --img-size 612 must be multiple of max stride 32, updating to 640

How can i see the Bounding box position in the picture?

Thanks
Best regards

from yoloface.

ModynAI avatar ModynAI commented on August 26, 2024

Thanks to you, i can have the bboxes and points but is it possible to use it on webcam? as a real time face detection?

Thanks
Best regards

from yoloface.

elyha7 avatar elyha7 commented on August 26, 2024

Thanks to you, i can have the bboxes and points but is it possible to use it on webcam? as a real time face detection?

Thanks Best regards

Yeah, you can. Follow this guide, but use my detector instead of Haar cascade.
https://realpython.com/face-detection-in-python-using-a-webcam/

from yoloface.

ModynAI avatar ModynAI commented on August 26, 2024

Thank you,

Have you tries to add TENSORT for the model as there is in
yolov5-face

from yoloface.

AndreKev avatar AndreKev commented on August 26, 2024

How did you proceed to draw the boxes ?

Think it can be done by simply drawing boxes in bbox. Alright ?

from yoloface.

elyha7 avatar elyha7 commented on August 26, 2024

How did you proceed to draw the boxes ?

Think it can be done by simply drawing boxes in bbox. Alright ?

You can use PIL, opencv or any other drawing library to draw bboxes and facial points. Here is an example using opencv.

for box,lm in zip(bboxes,points):
    x1,y1,x2,y2 = box
    orgimg = cv2.rectangle(orgimg,(x1,y1),(x2,y2),(255,0,0),3)
    for i in lm:
        x = i[0]
        y = i[1]
        orgimg = cv2.circle(orgimg, (x, y), 3, (0,255,0), -1)

from yoloface.

AndreKev avatar AndreKev commented on August 26, 2024

Furthermore, it seems like this model detects better with PIL images than with cv2 images.
Loading the linked image with cv2 gives 5 recognized faces, and loading with PIL gives 7 faces.

Here is the image: 48

loading the image with PIL (your loading technique) 7 faces:
new

Loading the image with cv2 5 faces:
new

I think it is all about colormode. You can consider let me sending a pull request to update drawing engine.

Congratulations. Do you know how I can improve my detection ?

from yoloface.

AndreKev avatar AndreKev commented on August 26, 2024

I just changes the minimum face size with PIL image rendering:

Result :
new

Awesome ! But still to be improved since some faces aren't shaded

from yoloface.

AndreKev avatar AndreKev commented on August 26, 2024

But I notice that in RGB some faces are detected and not in BGR, then vice versa !

from yoloface.

elyha7 avatar elyha7 commented on August 26, 2024

But I notice that in RGB some faces are detected and not in BGR, then vice versa !

The models were trained with rgb images and opencv by default uses bgr color space, so ofc better accuracy in rgb. In opencv color space can be changed with cv2.cvtColor() method. If you need better accuracy for smaller faces, consider using other models from deepcam-cn repo, i use one of the lightest ones in my repo.

from yoloface.

AndreKev avatar AndreKev commented on August 26, 2024

Alright but look at this image I link. You will notice that, some face are only detected in BGR (blue boxes) and not in RGB, then some face are only detected in RGB (red boxes) and not in BGR.

From hidden experience I think there is greater probability on detecting dark faces and faces with mufflers in BGR, but face detection in BGR outputs a little more false positives in these cases.

84_detected

from yoloface.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.