Ask Your Question

alfonsofernandezvillar's profile - activity

2020-09-24 01:56:43 -0600 received badge  Popular Question (source)
2019-05-08 10:09:01 -0600 received badge  Nice Question (source)
2019-01-13 04:05:49 -0600 commented answer draw detections when blobFromImages is used

Thanks for this link @berak. The "original" repo is:https://github.com/sfzhang15/FaceBoxes. And the paper is "FaceBo

2019-01-13 03:45:22 -0600 marked best answer draw detections when blobFromImages is used

Hello,

I was testing OpenCV face detection using a pre-trained model:

(h, w) = image.shape[:2]

net = cv2.dnn.readNetFromCaffe("deploy.prototxt.txt", "res10_300x300_ssd_iter_140000_fp16.caffemodel")
blob = cv2.dnn.blobFromImage(image, 1.0, (300, 300), [104., 117., 123.], False, False)
net.setInput(blob)
detections = net.forward()

for i in range(0, detections.shape[2]):
    confidence = detections[0, 0, i, 2]

    if confidence > 0.7:
        box = detections[0, 0, i, 3:7] * np.array([w, h, w, h])
        (startX, startY, endX, endY) = box.astype("int")

        text = "{:.2f}%".format(confidence * 100)
        y = startY - 10 if startY - 10 > 10 else startY + 10
        cv2.rectangle(image, (startX, startY), (endX, endY), (0, 0, 255), 2)
        cv2.putText(image, text, (startX, y), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (0, 0, 255), 2)

This example is working ok. But I don't now how to modify the code above in order to draw the detections if two images are used instead of only one:

blob2 = cv2.dnn.blobFromImages(images, 1.0, (300, 300), [104., 117., 123.], False, False)
net.setInput(blob2)
detections = net.forward()

How to draw the detections?

Thanks in advanced

2019-01-13 03:45:22 -0600 received badge  Scholar (source)
2019-01-13 03:36:54 -0600 received badge  Enthusiast
2019-01-12 03:51:19 -0600 commented question draw detections when blobFromImages is used

ok; yes, it was the problem, I didn't know how to separate the detections per image. Thanks @berak.

2019-01-11 13:32:26 -0600 edited question draw detections when blobFromImages is used

draw detections when blobFromImages is used Hello, I was testing OpenCV face detection using a pre-trained model: (h,

2019-01-11 13:32:26 -0600 received badge  Editor (source)
2019-01-11 13:31:37 -0600 asked a question draw detections when blobFromImages is used

draw detections when blobFromImages is used Hello, I was testing OpenCV face detection using a pre-trained model: (h,

2019-01-02 11:43:44 -0600 received badge  Student (source)
2019-01-02 11:33:15 -0600 commented question Using the Facemark API Python

I have an additional question related to Facemark API. I think that is too silly to question it in another (separate) qu

2019-01-02 10:43:44 -0600 commented question Using the Facemark API Python

Ok, thank you @berak.

2019-01-02 10:24:41 -0600 commented question Using the Facemark API Python

I have installed opencv using pip (Unofficial pre-built OpenCV packages for Python: opencv-python 3.4.5.20). So as you

2019-01-02 09:10:01 -0600 commented question Using the Facemark API Python

Yes, It's crashing inside the fit() function. I have seen the link you have provided. I can read de following: "Closin

2019-01-02 08:29:00 -0600 asked a question Using the Facemark API Python

Using the Facemark API Python Hi, So far I have been using dlib landmarks detector (both the 5 face landmarks detector

2013-06-17 09:08:20 -0600 received badge  Critic (source)
2013-06-14 06:46:32 -0600 received badge  Supporter (source)