Created
July 28, 2022 06:18
-
-
Save maltoze/e19e0c6ede77e686d34981ad24ebed94 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
import logging | |
import signal | |
import sys | |
def main(): | |
lib = ctypes.cdll.LoadLibrary( | |
"./bazel-bin/mediapipe/examples/desktop/object_detection_dll/object_detection_cpu.dll" | |
) | |
def signal_handler(sig, frame): | |
lib.MPPRelease() | |
sys.exit(0) | |
signal.signal(signal.SIGINT, signal_handler) | |
@ctypes.CFUNCTYPE(None, ctypes.c_int) | |
def callback(a): | |
print("Number of person: ", a) | |
lib.MPPSetNumPersonCallback(callback) | |
lib.MPPRunGraph() | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment