Skip to content

there's alittle bit slow #8

@Kiris-tingna

Description

@Kiris-tingna

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions