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

there's alittle bit slow #8

Open
Kiris-tingna opened this issue Jun 28, 2022 · 0 comments
Open

there's alittle bit slow #8

Kiris-tingna opened this issue Jun 28, 2022 · 0 comments

Comments

@Kiris-tingna
Copy link

i am using this within a flask backend and it works well , but i get base64 encode face image quiet slow. Theres is at least 2s delay.

def detect2(file):
    ret = []
    img = Image.open(file)
    faces = animeface.detect(img)
    
    for it in faces:
        fp = it.face.pos
        # print(fp)
        buffer = BytesIO()
        crop = img.crop((fp.x, fp.y, fp.x + fp.width, fp.y + fp.height))
        crop.save(buffer, format='png')
        byte_data = buffer.getvalue()
        image_str = base64.b64encode(byte_data).decode()
        ret.append({"face": image_str})

    return ret
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