|
import deeplabcut |
|
from tkinter import W |
|
import gradio as gr |
|
import numpy as np |
|
from dlclive import DLCLive, Processor |
|
|
|
|
|
|
|
def predict_dlc(list_np_crops, |
|
kpts_likelihood_th, |
|
dlc_model_folder, |
|
dlc_proc): |
|
|
|
|
|
dlc_live = DLCLive(dlc_model_folder, processor=dlc_proc) |
|
dlc_live.init_inference(list_np_crops[0]) |
|
|
|
list_kpts_per_crop = [] |
|
all_kypts = [] |
|
np_aux = np.empty((1,3)) |
|
for crop in list_np_crops: |
|
|
|
keypts_xyp = dlc_live.get_pose(crop) |
|
|
|
|
|
|
|
keypts_xyp[keypts_xyp[:,-1] < kpts_likelihood_th,:] = np_aux.fill(np.nan) |
|
|
|
list_kpts_per_crop.append(keypts_xyp) |
|
all_kypts.append(keypts_xyp) |
|
|
|
return list_kpts_per_crop |
|
|
|
|
|
''' |
|
File "/home/user/.local/lib/python3.8/site-packages/dlclive/dlclive.py", line 168, in read_config |
|
raise FileNotFoundError( |
|
FileNotFoundError: The pose configuration file for the exported model at /home/user/app/superanimal_quadruped/pose_cfg.yaml was not found. Please check the path to the exported model directory |
|
''' |