How to convert modified python mediapie model to tfllite to use in flutter app

52 views Asked by At

I am trying to build a pose correction app where i get the the first image and second image as input. I have a python file with a function "get_detected_image" where I use mediapipe pose detection to get the stick diagram of both the images, use a custom function made by me to calculate the angles between the joints and then find the percentage error in the difference of angles and then attach both the stick diagram of 1st and 2nd image on to the second image and return the second image. In the flutter app i can get the image from the camera, But i cant call this python file in the flutter app that I am making because it doesnt support call from a python file. It supports a tflite file, so I am thinking of converting this python file to a tflite file. Is there a way to do that? Is there any other way to call the function by importing this file in the flutter app and calling the "get_detected_image" function and then displaying the returned 2nd image on the app?

I tried calling the functuion by importing the python file but it doesnt work. Below is the usage of "get_detected_image" I was talking aboout.

# image = cv2.imread("./tst2.jpg")
# img1 = cv2.imread("./tst6.png")
# lnd_tree_pose = return_detect_landmarks(image)
# detected_img, score = get_detected_image(lnd_tree_pose, img1)
# cv2.imshow("img", detected_img)
# cv2.waitKey(0)
# cv2.destroyAllWindows()

0

There are 0 answers