dmarx / whats-in-a-name

[WIP] probing identity and bias in text to image models
MIT License
1 stars 1 forks source link

find a decent, lightweight face parsing model for face segmentation #28

Closed dmarx closed 9 months ago

dmarx commented 9 months ago

https://paperswithcode.com/sota/face-parsing-on-celebamask-hq

dmarx commented 9 months ago

https://github.com/FacePerceiver/facer

dmarx commented 9 months ago

CelebAMask-HQ - https://mmlab.ie.cuhk.edu.hk/projects/CelebA/CelebAMask_HQ.html

dmarx commented 9 months ago

where's the model zoo in this thing?

https://github.com/FacePerceiver/facer/releases/tag/models-v1

dmarx commented 9 months ago
pretrained_urls = {
    "mobilenet": "https://github.com/elliottzheng/face-detection/releases/download/0.0.1/mobilenet0.25_Final.pth",
    "resnet50": "https://github.com/elliottzheng/face-detection/releases/download/0.0.1/Resnet50_Final.pth"
}
dmarx commented 9 months ago

https://github.com/FacePerceiver/facer/blob/main/facer/face_parsing/farl.py#L11C1-L42C2

pretrain_settings = {
    'lapa/448': {
        'url': [
            'https://github.com/FacePerceiver/facer/releases/download/models-v1/face_parsing.farl.lapa.main_ema_136500_jit191.pt',
        ],
        'matrix_src_tag': 'points',
        'get_matrix_fn': functools.partial(get_face_align_matrix,
                                           target_shape=(448, 448), target_face_scale=1.0),
        'get_grid_fn': functools.partial(make_tanh_warp_grid,
                                         warp_factor=0.8, warped_shape=(448, 448)),
        'get_inv_grid_fn': functools.partial(make_inverted_tanh_warp_grid,
                                             warp_factor=0.8, warped_shape=(448, 448)),
        'label_names': ['background', 'face', 'rb', 'lb', 're',
                        'le', 'nose',  'ulip', 'imouth', 'llip', 'hair']
    },
    'celebm/448': {
        'url': [
            'https://github.com/FacePerceiver/facer/releases/download/models-v1/face_parsing.farl.celebm.main_ema_181500_jit.pt',
        ],
        'matrix_src_tag': 'points',
        'get_matrix_fn': functools.partial(get_face_align_matrix_celebm,
                                           target_shape=(448, 448)),
        'get_grid_fn': functools.partial(make_tanh_warp_grid,
                                         warp_factor=0, warped_shape=(448, 448)),
        'get_inv_grid_fn': functools.partial(make_inverted_tanh_warp_grid,
                                             warp_factor=0, warped_shape=(448, 448)),
        'label_names':  [
                    'background', 'neck', 'face', 'cloth', 'rr', 'lr', 'rb', 'lb', 're',
                    'le', 'nose', 'imouth', 'llip', 'ulip', 'hair',
                    'eyeg', 'hat', 'earr', 'neck_l']
    }
}