ZhangYuanhan-AI / CelebA-Spoof

[ECCV2020] A Large-Scale Face Anti-Spoofing Dataset
531 stars 92 forks source link

About celeba Spoof bbox detection #21

Closed mremise closed 3 years ago

mremise commented 3 years ago

Hello,

What algorithm did you use for the bounding box detection on your celeba spoof dataset ?

Thank you

mremise commented 3 years ago

The bounding box of faces are extracted by RetinaFace

liuyuchen6666 commented 3 years ago

Hello, How to extract the faces with the bbox? I used to think the value in the bbox.txt is [x1,y1,w,h], but it seems wrong because the extracted part is not the face. Can you help me? Thanks a lot.

mremise commented 3 years ago

I use directly retinaface to extract it

liuyuchen6666 commented 3 years ago

Thanks. Can we directly use the bbox.txt that already contained in this dataset so we can save time ?

PhanThanhTrung commented 3 years ago

I found that there are some images that have wrong bounding box coordinates

ThanhNhanKTMT2018 commented 1 year ago

Hello, How to extract the faces with the bbox? I used to think the value in the bbox.txt is [x1,y1,w,h], but it seems wrong because the extracted part is not the face. Can you help me? Thanks a lot.

If you read README carefully, you will see the instruction of the way how to extract the faces: bbox = [61 45 61 112 0.9970805] bbox[0]: x value of the upper left corner bbox[1]: y value of the upper left corner bbox[2]: w value of bbox bbox[3]: h value of bbox bbox[4]: score of bbox - How to use bbox to crop face?

  1. Get the shape of image: real_h, real_w
  2. x1 = int(bbox[0](real_w / 224)) y1 = int(bbox[1](real_h / 224)) w1 = int(bbox[2](real_w / 224)) h1 = int(bbox[3](real_h / 224))
  3. Then x1, y1, w1, h1 are the real bbox values of image Finally you can extract face image by: face_img = original_img[y1:y1+h1, x1:x1+w1]
EchoAndBroly commented 4 months ago

Hello, How to extract the faces with the bbox? I used to think the value in the bbox.txt is [x1,y1,w,h], but it seems wrong because the extracted part is not the face. Can you help me? Thanks a lot.

If you read README carefully, you will see the instruction of the way how to extract the faces: bbox = [61 45 61 112 0.9970805] bbox[0]: x value of the upper left corner bbox[1]: y value of the upper left corner bbox[2]: w value of bbox bbox[3]: h value of bbox bbox[4]: score of bbox - How to use bbox to crop face?

  1. Get the shape of image: real_h, real_w
  2. x1 = int(bbox[0]_(realw / 224)) y1 = int(bbox[1](realh / 224)) w1 = int(bbox[2](realw / 224)) h1 = int(bbox[3](real_h / 224))
  3. Then x1, y1, w1, h1 are the real bbox values of image Finally you can extract face image by: face_img = original_img[y1:y1+h1, x1:x1+w1]

But I found that even by this way you mentioned there is still some wrong values that beyond the bound of image