-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
I run this code with pretrained, the output is follow:
torchlm.runtime.bind(
faceboxesv2(device="cpu")
) # set device="cuda" if you want to run with CUDA
# set map_location="cuda" if you want to run with CUDA
torchlm.runtime.bind(
pipnet(
backbone="resnet18",
pretrained=True,
num_nb=10,
num_lms=98,
net_stride=32,
input_size=256,
meanface_type="wflw",
map_location="cpu",
# checkpoint="=pipnet_resnet18_10x98x32x256_wflw.pth",
)
) # will auto download pretrained weights from latest release if pretrained=True
# image should be HWC, BGR/RGB
landmarks, bboxes = torchlm.runtime.forward(
image, swapRB_before_face=True, swapRB_before_landmarks=True
)
# swap h and w
# landmarks =
print(landmarks.shape)
image = torchlm.utils.draw_bboxes(image, bboxes=bboxes)
image = torchlm.utils.draw_landmarks(image, landmarks=landmarks)
Image.fromarray(image)If i downloaded the weights file from Releases with checkpoint, then it is ok
torchlm.runtime.bind(
faceboxesv2(device="cpu")
) # set device="cuda" if you want to run with CUDA
# set map_location="cuda" if you want to run with CUDA
torchlm.runtime.bind(
pipnet(
backbone="resnet18",
pretrained=True,
num_nb=10,
num_lms=98,
net_stride=32,
input_size=256,
meanface_type="wflw",
map_location="cpu",
checkpoint="=pipnet_resnet18_10x98x32x256_wflw.pth",
)
) # will auto download pretrained weights from latest release if pretrained=True
# image should be HWC, BGR/RGB
landmarks, bboxes = torchlm.runtime.forward(
image, swapRB_before_face=True, swapRB_before_landmarks=True
)
# swap h and w
# landmarks =
print(landmarks.shape)
image = torchlm.utils.draw_bboxes(image, bboxes=bboxes)
image = torchlm.utils.draw_landmarks(image, landmarks=landmarks)
Image.fromarray(image)
Metadata
Metadata
Assignees
Labels
No labels

