How to get the hand landmarks?
Opened this issue · 1 comments
bophancong commented
@afsaredrisy Hi. It's a nice work. I have tried to run your code with Bitmap image successfully. However, I have a problem in obtaining the hand landmarks. Could you please let's me know how could a obtain the hand landmarks if you have tried? Thank you very much.
CaydenPierce commented
Add this callback to the processor to get landmarks. On my custom graph, this only runs when the graph actually passes the output landmark stream as specified by OUTPUT_LANDMARKS_STREAM_NAME
processor.addPacketCallback(
OUTPUT_LANDMARKS_STREAM_NAME,
(packet) -> {
Log.d(TAG, "PACKET CALLBACK");
byte[] landmarksRaw = PacketGetter.getProtoBytes(packet);
try {
NormalizedLandmarkList landmarks = NormalizedLandmarkList.parseFrom(landmarksRaw);
if (landmarks == null) {
Log.d(TAG, "[TS:" + packet.getTimestamp() + "] No landmarks.");
return;
}
} catch (InvalidProtocolBufferException e) {
Log.e(TAG, "Couldn't Exception received - " + e);
return;
}
});