Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about the data preprocess of oulu #13

Open
lexuszhi1990 opened this issue Oct 18, 2022 · 0 comments
Open

about the data preprocess of oulu #13

lexuszhi1990 opened this issue Oct 18, 2022 · 0 comments

Comments

@lexuszhi1990
Copy link

hi, according to the code and papers, I have a question for OULUNPU dataset in preprocess, it seems that crop_face_from_scene function only works on full image without cropping face in image?

https://github.com/wangzhuo2019/SSAN/blob/main/datasets/Load_OULUNPU_train.py#L14

def crop_face_from_scene(image, scale):
    y1,x1,w,h = 0, 0, image.shape[1], image.shape[0]
    y2=y1+w
    x2=x1+h
    y_mid=(y1+y2)/2.0
    x_mid=(x1+x2)/2.0
    w_scale=scale/1.5*w
    h_scale=scale/1.5*h
    h_img, w_img = image.shape[0], image.shape[1]
    y1=y_mid-w_scale/2.0
    x1=x_mid-h_scale/2.0
    y2=y_mid+w_scale/2.0
    x2=x_mid+h_scale/2.0
    y1=max(math.floor(y1),0)
    x1=max(math.floor(x1),0)
    y2=min(math.floor(y2),w_img)
    x2=min(math.floor(x2),h_img)
    region=image[x1:x2,y1:y2]
    return region
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant