Bläddra i källkod

fixed kpt obj shitu pipeline results (#2979)

学卿 9 månader sedan
förälder
incheckning
3470a16c2b

+ 161 - 161
docs/pipeline_usage/tutorials/cv_pipelines/human_keypoint_detection.md

@@ -267,167 +267,167 @@ for res in output:
 <ul><li><details><summary>👉 调用 <code>print()</code> 方法会将如下结果打印到终端(点击展开):</summary>
 
 ```bash
-{'res': {'input_path': 'keypoint_detection_001.jpg', 'boxes': [{'coordinate': [325.65088, 74.46718, 391.5512, 209.46529], 'det_score': 0.9316536784172058, 'keypoints': array([[3.52227936e+02, 8.88497543e+01, 5.41676700e-01],
-       [3.51974579e+02, 8.66366196e+01, 6.21515572e-01],
-       [3.52865662e+02, 8.64902344e+01, 5.60755610e-01],
-       [3.50862457e+02, 8.75393066e+01, 5.66961825e-01],
-       [3.57415802e+02, 8.63235092e+01, 5.54250121e-01],
-       [3.39434937e+02, 9.99389191e+01, 6.28665030e-01],
-       [3.69297821e+02, 1.01169853e+02, 6.00828469e-01],
-       [3.36788544e+02, 1.18020966e+02, 5.31029820e-01],
-       [3.71721039e+02, 1.22033646e+02, 6.07613802e-01],
-       [3.66371948e+02, 1.40476746e+02, 1.52681962e-01],
-       [3.67885651e+02, 1.39969559e+02, 3.90044987e-01],
-       [3.47553253e+02, 1.42274353e+02, 5.21435857e-01],
-       [3.60833710e+02, 1.42503479e+02, 4.64817137e-01],
-       [3.40133362e+02, 1.67570465e+02, 5.92474759e-01],
-       [3.74433594e+02, 1.69982712e+02, 5.48423827e-01],
-       [3.37616333e+02, 1.92737564e+02, 5.85887253e-01],
-       [3.82684723e+02, 1.96479385e+02, 6.19615853e-01]], dtype=float32), 'kpt_score': 0.53462815}, {'coordinate': [271.96713, 69.02892, 336.77832, 217.54662], 'det_score': 0.9304604530334473, 'keypoints': array([[2.96400787e+02, 8.58611679e+01, 7.14319646e-01],
-       [2.97301758e+02, 8.28755493e+01, 7.04051554e-01],
-       [2.94497406e+02, 8.29398193e+01, 6.89844370e-01],
-       [3.00162109e+02, 8.35247955e+01, 5.55446565e-01],
-       [2.93188751e+02, 8.33744202e+01, 6.51386738e-01],
-       [3.12854675e+02, 9.81457520e+01, 7.32430100e-01],
-       [2.86463226e+02, 1.01262375e+02, 6.10454917e-01],
-       [3.19350311e+02, 1.18383713e+02, 5.93547344e-01],
-       [2.82401520e+02, 1.21164886e+02, 5.71586847e-01],
-       [3.23966248e+02, 1.39364532e+02, 5.18607676e-01],
-       [2.82263916e+02, 1.44509521e+02, 2.59432912e-01],
-       [3.09791840e+02, 1.43603912e+02, 6.89817309e-01],
-       [2.94868561e+02, 1.44677597e+02, 5.97069323e-01],
-       [3.14365845e+02, 1.74088943e+02, 6.36058152e-01],
-       [2.92653442e+02, 1.75070770e+02, 5.97140312e-01],
-       [3.19849792e+02, 2.02162598e+02, 6.80035114e-01],
-       [2.94255920e+02, 2.03049500e+02, 6.08293772e-01]], dtype=float32), 'kpt_score': 0.6123249}, {'coordinate': [293.55933, 188.65804, 419.47382, 305.4712], 'det_score': 0.9179267883300781, 'keypoints': array([[3.33173096e+02, 2.05474487e+02, 5.18341482e-01],
-       [3.36098663e+02, 2.03492996e+02, 5.60671568e-01],
-       [3.37248505e+02, 2.03364868e+02, 5.00729203e-01],
-       [3.40604095e+02, 2.02393539e+02, 4.98033434e-01],
-       [3.43625671e+02, 2.01539536e+02, 6.13991261e-01],
-       [3.24516022e+02, 2.18521667e+02, 3.14208776e-01],
-       [3.52951965e+02, 2.12051971e+02, 4.42923039e-01],
-       [3.14448853e+02, 2.22776672e+02, 2.55664617e-01],
-       [3.65774384e+02, 2.25498718e+02, 8.26140717e-02],
-       [3.06869843e+02, 2.34243729e+02, 1.35185301e-01],
-       [3.08855865e+02, 2.36824249e+02, 1.00039296e-01],
-       [3.82195679e+02, 2.42062302e+02, 5.45506418e-01],
-       [3.88757233e+02, 2.42933960e+02, 5.79574823e-01],
-       [3.50280792e+02, 2.56009766e+02, 7.92343557e-01],
-       [3.70955750e+02, 2.74127930e+02, 5.06902397e-01],
-       [3.61553833e+02, 2.83896454e+02, 6.03924632e-01],
-       [3.94064087e+02, 2.88825836e+02, 3.72752368e-01]], dtype=float32), 'kpt_score': 0.43667096}, {'coordinate': [238.98825, 182.67476, 372.81628, 307.61395], 'det_score': 0.914400041103363, 'keypoints': array([[281.63354   , 197.61014   ,   0.76263565],
-       [283.38297   , 195.05458   ,   0.8535259 ],
-       [277.73865   , 192.96712   ,   0.7486459 ],
-       [282.2258    , 197.37396   ,   0.5293759 ],
-       [267.41278   , 193.56656   ,   0.6177453 ],
-       [269.7986    , 215.17424   ,   0.6587688 ],
-       [259.27332   , 214.76183   ,   0.7745857 ],
-       [277.53683   , 237.42062   ,   0.48790172],
-       [260.1237    , 240.18477   ,   0.44012186],
-       [293.51572   , 250.89894   ,   0.49827316],
-       [290.2274    , 252.19504   ,   0.58322966],
-       [279.096     , 260.06042   ,   0.6834831 ],
-       [269.9528    , 265.9034    ,   0.74632865],
-       [313.1393    , 260.79523   ,   0.6337413 ],
-       [310.01425   , 262.5001    ,   0.7376388 ],
-       [348.17996   , 283.56802   ,   0.6096815 ],
-       [334.12622   , 292.06284   ,   0.805234  ]], dtype=float32), 'kpt_score': 0.6571127}, {'coordinate': [66.23172, 93.531204, 124.48463, 217.99655], 'det_score': 0.9086756110191345, 'keypoints': array([[ 91.31993   , 108.413284  ,   0.615049  ],
-       [ 92.08924   , 106.03603   ,   0.63400346],
-       [ 88.434235  , 105.775925  ,   0.6342117 ],
-       [ 94.41964   , 106.27531   ,   0.5885308 ],
-       [ 84.07658   , 105.80367   ,   0.6773151 ],
-       [100.38561   , 118.80038   ,   0.74734527],
-       [ 79.46563   , 119.58027   ,   0.7821885 ],
-       [102.27228   , 136.0127    ,   0.5907435 ],
-       [ 73.76375   , 135.51848   ,   0.7132327 ],
-       [101.763245  , 148.3819    ,   0.35871926],
-       [ 72.33199   , 148.83861   ,   0.5405212 ],
-       [ 99.1199    , 151.6756    ,   0.83278877],
-       [ 86.4599    , 152.03287   ,   0.78065455],
-       [106.40269   , 176.46979   ,   0.75466657],
-       [ 84.909454  , 178.44617   ,   0.76010597],
-       [110.97942   , 201.19633   ,   0.7917331 ],
-       [ 79.87372   , 202.87093   ,   0.79150075]], dtype=float32), 'kpt_score': 0.68195945}, {'coordinate': [160.1294, 78.35935, 212.01868, 153.2241], 'det_score': 0.8295672535896301, 'keypoints': array([[1.8115924e+02, 1.0371443e+02, 2.5303254e-01],
-       [1.8318883e+02, 9.6959526e+01, 1.5748371e-01],
-       [1.8303551e+02, 9.8071350e+01, 2.1673845e-01],
-       [1.8769695e+02, 9.1113632e+01, 1.4220884e-01],
-       [1.8665227e+02, 9.1424126e+01, 1.2998220e-01],
-       [1.9881558e+02, 9.9527107e+01, 2.6830634e-01],
-       [1.8619264e+02, 9.9051491e+01, 1.8842754e-01],
-       [1.9972902e+02, 1.2386106e+02, 4.7812667e-01],
-       [1.8038458e+02, 1.2146417e+02, 1.7550260e-01],
-       [1.8155409e+02, 1.3735040e+02, 3.2514629e-01],
-       [1.7971712e+02, 1.3371999e+02, 1.1313542e-01],
-       [1.9606516e+02, 1.4140919e+02, 2.3604973e-01],
-       [1.8650092e+02, 1.4260675e+02, 1.3515554e-01],
-       [1.9617020e+02, 1.2273723e+02, 9.6943676e-02],
-       [1.6671684e+02, 1.2564886e+02, 1.2711491e-01],
-       [1.8317670e+02, 1.3923177e+02, 1.0834377e-01],
-       [1.7997801e+02, 1.3850316e+02, 9.3360245e-02]], dtype=float32), 'kpt_score': 0.19088578}, {'coordinate': [52.482475, 59.36664, 96.47121, 135.45993], 'det_score': 0.7726763486862183, 'keypoints': array([[7.38075943e+01, 7.33277664e+01, 1.63257480e-01],
-       [7.37732239e+01, 7.15934525e+01, 1.55248597e-01],
-       [7.20166702e+01, 7.13588028e+01, 1.96659654e-01],
-       [6.95982971e+01, 7.10932083e+01, 1.26999229e-01],
-       [6.98693237e+01, 7.16391983e+01, 1.35578454e-01],
-       [8.22228088e+01, 7.77278976e+01, 2.35379949e-01],
-       [6.47475586e+01, 7.88423233e+01, 2.10787609e-01],
-       [8.33889618e+01, 9.05893707e+01, 2.98420697e-01],
-       [8.30510330e+01, 9.10888824e+01, 1.13309503e-01],
-       [8.09216843e+01, 9.85093231e+01, 1.84670463e-01],
-       [7.77405396e+01, 1.01128220e+02, 1.49517819e-01],
-       [7.58817215e+01, 1.02311646e+02, 7.63842911e-02],
-       [6.97640839e+01, 1.01978600e+02, 9.00617689e-02],
-       [8.89746017e+01, 9.87928925e+01, 2.00097740e-01],
-       [6.45541153e+01, 1.04130150e+02, 1.00787796e-01],
-       [8.81069489e+01, 1.19858818e+02, 1.84717909e-01],
-       [7.08108673e+01, 1.38108154e+02, 9.07213315e-02]], dtype=float32), 'kpt_score': 0.15956473}, {'coordinate': [7.081953, 80.3705, 46.81927, 161.72012], 'det_score': 0.6587498784065247, 'keypoints': array([[2.68747215e+01, 9.24635468e+01, 3.17601502e-01],
-       [2.71188889e+01, 9.08834305e+01, 2.46545449e-01],
-       [2.69905357e+01, 9.03851013e+01, 3.27626228e-01],
-       [2.34424419e+01, 8.87997513e+01, 2.75899678e-01],
-       [3.25261230e+01, 8.93143845e+01, 3.42958122e-01],
-       [1.98818531e+01, 9.67693405e+01, 2.83849210e-01],
-       [3.82729301e+01, 9.91002884e+01, 3.19851965e-01],
-       [1.63669338e+01, 1.10157967e+02, 1.96907550e-01],
-       [4.11151352e+01, 1.10147133e+02, 2.70823181e-01],
-       [1.86983719e+01, 1.17376358e+02, 1.15746662e-01],
-       [1.98090267e+01, 1.16526924e+02, 1.02475688e-01],
-       [2.51145611e+01, 1.23519379e+02, 3.24807376e-01],
-       [3.34709854e+01, 1.24678688e+02, 2.65269905e-01],
-       [2.82129307e+01, 1.42196121e+02, 2.98054874e-01],
-       [2.94088726e+01, 1.42497360e+02, 3.57838601e-01],
-       [2.95637341e+01, 1.57201065e+02, 2.14882523e-01],
-       [3.03766575e+01, 1.57535706e+02, 2.10423440e-01]], dtype=float32), 'kpt_score': 0.26303306}, {'coordinate': [126.131096, 30.263107, 168.5759, 134.09885], 'det_score': 0.6441988348960876, 'keypoints': array([[148.10135   ,  40.584896  ,   0.44685563],
-       [150.00848   ,  38.423157  ,   0.5721373 ],
-       [146.84933   ,  38.88104   ,   0.5450204 ],
-       [153.57166   ,  38.53051   ,   0.58872294],
-       [144.609     ,  38.854267  ,   0.54383296],
-       [158.78825   ,  51.609245  ,   0.6847385 ],
-       [141.20293   ,  49.92705   ,   0.52605945],
-       [157.85371   ,  70.32525   ,   0.7879656 ],
-       [136.42497   ,  68.15052   ,   0.4752547 ],
-       [144.46915   ,  79.161385  ,   0.5807479 ],
-       [135.84734   ,  75.86984   ,   0.32583416],
-       [155.16513   ,  78.74157   ,   0.56849873],
-       [141.66093   ,  77.88423   ,   0.45576522],
-       [152.68689   , 100.64953   ,   0.5331878 ],
-       [130.97485   ,  87.03784   ,   0.73304355],
-       [153.57033   , 123.742294  ,   0.39946193],
-       [132.91501   , 114.52923   ,   0.36085486]], dtype=float32), 'kpt_score': 0.5369401}, {'coordinate': [112.50212, 64.127, 150.35353, 125.85529], 'det_score': 0.5013833045959473, 'keypoints': array([[1.34417511e+02, 7.67317352e+01, 8.11196864e-02],
-       [1.33561203e+02, 7.61824722e+01, 5.88811524e-02],
-       [1.33302322e+02, 7.54709702e+01, 3.77583615e-02],
-       [1.33238602e+02, 7.65276260e+01, 8.76586884e-02],
-       [1.27832169e+02, 7.29993439e+01, 5.68802767e-02],
-       [1.32234711e+02, 8.55900650e+01, 6.25893995e-02],
-       [1.29263702e+02, 8.66081772e+01, 7.35298842e-02],
-       [1.17821297e+02, 6.38808823e+01, 1.47604376e-01],
-       [1.17373665e+02, 6.40265808e+01, 1.84295043e-01],
-       [1.39441742e+02, 9.73589020e+01, 6.45915419e-02],
-       [1.24748589e+02, 1.04544739e+02, 5.86665794e-02],
-       [1.35098206e+02, 7.81749954e+01, 8.30232948e-02],
-       [1.34638489e+02, 7.91068802e+01, 8.16871747e-02],
-       [1.36119888e+02, 8.93165436e+01, 1.34096310e-01],
-       [1.30067749e+02, 9.34937820e+01, 8.98712277e-02],
-       [1.36004654e+02, 1.16780487e+02, 1.60800099e-01],
-       [1.28087891e+02, 1.15956802e+02, 1.99588016e-01]], dtype=float32), 'kpt_score': 0.097802415}]}}
+{'res': {'input_path': 'keypoint_detection_001.jpg', 'boxes': [{'coordinate': [325.65088, 74.46718, 391.5512, 209.46529], 'det_score': 0.9316536784172058, 'keypoints': array([[351.6419    ,  84.80058   ,   0.79337054],
+       [353.9377    ,  82.47209   ,   0.7778817 ],
+       [349.12946   ,  83.09801   ,   0.7885327 ],
+       [359.24466   ,  83.369225  ,   0.80503   ],
+       [347.46167   ,  84.1535    ,   0.8710606 ],
+       [368.82172   , 101.33514   ,   0.88625187],
+       [339.8064    ,  99.65537   ,   0.8432633 ],
+       [371.2092    , 123.35563   ,   0.7728337 ],
+       [337.78214   , 121.36371   ,   0.9310819 ],
+       [368.81366   , 142.71593   ,   0.79723483],
+       [337.53455   , 139.85892   ,   0.877297  ],
+       [363.0265    , 141.82988   ,   0.7964988 ],
+       [345.3075    , 141.98972   ,   0.7532031 ],
+       [374.60806   , 171.42578   ,   0.7530604 ],
+       [339.11694   , 167.98814   ,   0.7255032 ],
+       [382.67047   , 197.82553   ,   0.73685765],
+       [336.79745   , 196.5194    ,   0.626142  ]], dtype=float32), 'kpt_score': 0.7961825}, {'coordinate': [271.96713, 69.02892, 336.77832, 217.54662], 'det_score': 0.9304604530334473, 'keypoints': array([[294.48553   ,  84.144104  ,   0.74851245],
+       [297.09854   ,  80.97825   ,   0.7341483 ],
+       [292.39313   ,  81.7721    ,   0.74603605],
+       [302.3231    ,  81.528275  ,   0.7586238 ],
+       [290.6292    ,  83.26544   ,   0.7514231 ],
+       [313.32928   ,  98.40588   ,   0.83778954],
+       [286.23532   , 101.702194  ,   0.91927457],
+       [321.99515   , 120.05991   ,   0.90197486],
+       [282.39294   , 122.16547   ,   0.74502975],
+       [327.164     , 141.25995   ,   0.8172762 ],
+       [279.1632    , 133.16023   ,   0.59161717],
+       [311.02557   , 142.31526   ,   0.82111686],
+       [294.72357   , 143.42067   ,   0.71559554],
+       [313.98828   , 174.17151   ,   0.7495116 ],
+       [291.76605   , 174.39961   ,   0.7645517 ],
+       [321.4924    , 202.4499    ,   0.7817023 ],
+       [293.70663   , 204.9227    ,   0.72405976]], dtype=float32), 'kpt_score': 0.77107316}, {'coordinate': [293.55933, 188.65804, 419.47382, 305.4712], 'det_score': 0.9179267883300781, 'keypoints': array([[3.3565637e+02, 2.0941801e+02, 8.1438643e-01],
+       [3.3636591e+02, 2.0724442e+02, 7.7529407e-01],
+       [3.3486487e+02, 2.0653752e+02, 8.3719862e-01],
+       [3.4387805e+02, 2.0405179e+02, 7.9793924e-01],
+       [3.4104437e+02, 2.0354083e+02, 6.7090714e-01],
+       [3.5167136e+02, 2.1253050e+02, 5.9533423e-01],
+       [3.5493774e+02, 2.1316977e+02, 5.1632988e-01],
+       [3.2814764e+02, 2.1943013e+02, 5.3697169e-01],
+       [3.2577945e+02, 2.2027420e+02, 1.6555195e-01],
+       [3.1541614e+02, 2.2199020e+02, 5.2568728e-01],
+       [3.1139435e+02, 2.2925937e+02, 2.2075935e-01],
+       [3.8441351e+02, 2.4341478e+02, 6.4083064e-01],
+       [3.8714008e+02, 2.4532764e+02, 6.4894527e-01],
+       [3.5143246e+02, 2.5615021e+02, 7.7424920e-01],
+       [3.7133820e+02, 2.7552402e+02, 5.8704698e-01],
+       [3.6274625e+02, 2.8303183e+02, 6.1670756e-01],
+       [4.0358893e+02, 2.9351334e+02, 4.2383862e-01]], dtype=float32), 'kpt_score': 0.5969399}, {'coordinate': [238.98825, 182.67476, 372.81628, 307.61395], 'det_score': 0.914400041103363, 'keypoints': array([[282.9012    , 208.31485   ,   0.6685285 ],
+       [282.95908   , 204.36131   ,   0.66104335],
+       [280.90683   , 204.54018   ,   0.7281709 ],
+       [274.7831    , 204.04141   ,   0.54541856],
+       [270.97324   , 203.04889   ,   0.73486483],
+       [269.43472   , 217.63014   ,   0.6707946 ],
+       [256.871     , 216.546     ,   0.89603853],
+       [277.03226   , 238.2196    ,   0.4412233 ],
+       [262.29578   , 241.33434   ,   0.791063  ],
+       [292.90753   , 251.69914   ,   0.4993091 ],
+       [285.6907    , 252.71925   ,   0.7215052 ],
+       [279.36578   , 261.8949    ,   0.6626504 ],
+       [270.43402   , 268.07068   ,   0.80625033],
+       [311.96924   , 261.36716   ,   0.67315185],
+       [309.32407   , 262.97354   ,   0.72746485],
+       [345.22446   , 285.02255   ,   0.60142016],
+       [334.69235   , 291.57108   ,   0.7674925 ]], dtype=float32), 'kpt_score': 0.6821406}, {'coordinate': [66.23172, 93.531204, 124.48463, 217.99655], 'det_score': 0.9086756110191345, 'keypoints': array([[ 91.04524   , 108.79487   ,   0.8234256 ],
+       [ 92.67917   , 106.63517   ,   0.79848343],
+       [ 88.41122   , 106.8017    ,   0.8122996 ],
+       [ 95.353096  , 106.96488   ,   0.85210425],
+       [ 84.35098   , 107.85205   ,   0.971826  ],
+       [ 99.92103   , 119.87272   ,   0.853371  ],
+       [ 79.69138   , 121.08684   ,   0.8854925 ],
+       [103.019554  , 135.00996   ,   0.73513967],
+       [ 72.38997   , 136.8782    ,   0.7727014 ],
+       [104.561935  , 146.01869   ,   0.8377464 ],
+       [ 72.70636   , 151.44576   ,   0.67577386],
+       [ 98.69484   , 151.30742   ,   0.8381225 ],
+       [ 85.946     , 152.07056   ,   0.7904873 ],
+       [106.64397   , 175.77159   ,   0.8179414 ],
+       [ 84.6963    , 178.4353    ,   0.8094256 ],
+       [111.30463   , 201.2306    ,   0.74394226],
+       [ 80.08708   , 204.05814   ,   0.8457697 ]], dtype=float32), 'kpt_score': 0.8155325}, {'coordinate': [160.1294, 78.35935, 212.01868, 153.2241], 'det_score': 0.8295672535896301, 'keypoints': array([[1.89240387e+02, 9.08055573e+01, 7.36447990e-01],
+       [1.91318649e+02, 8.84640198e+01, 7.86390483e-01],
+       [1.87943207e+02, 8.88532104e+01, 8.23230743e-01],
+       [1.95832245e+02, 8.76751480e+01, 6.76276207e-01],
+       [1.86741409e+02, 8.96744080e+01, 7.87400603e-01],
+       [2.04019852e+02, 9.83068924e+01, 7.34004617e-01],
+       [1.85355087e+02, 9.81262970e+01, 6.23330474e-01],
+       [2.01501678e+02, 1.12709480e+02, 2.93740422e-01],
+       [1.80446320e+02, 1.11967369e+02, 5.50001860e-01],
+       [1.95137482e+02, 9.73322601e+01, 4.24658984e-01],
+       [1.74287552e+02, 1.21760696e+02, 3.51236403e-01],
+       [1.97997589e+02, 1.24219963e+02, 3.45360219e-01],
+       [1.83250824e+02, 1.22610085e+02, 4.38733459e-01],
+       [1.96233871e+02, 1.22864418e+02, 5.36903977e-01],
+       [1.66795364e+02, 1.25634903e+02, 3.78726840e-01],
+       [1.80727753e+02, 1.42604034e+02, 2.78717279e-01],
+       [1.75880920e+02, 1.41181213e+02, 1.70833692e-01]], dtype=float32), 'kpt_score': 0.5256467}, {'coordinate': [52.482475, 59.36664, 96.47121, 135.45993], 'det_score': 0.7726763486862183, 'keypoints': array([[ 73.98227   ,  74.01257   ,   0.71940714],
+       [ 75.44208   ,  71.73432   ,   0.6955297 ],
+       [ 72.20365   ,  71.9637    ,   0.6138198 ],
+       [ 77.7856    ,  71.665825  ,   0.73568064],
+       [ 69.342285  ,  72.25549   ,   0.6311799 ],
+       [ 83.1019    ,  77.65522   ,   0.7037722 ],
+       [ 64.89729   ,  78.846565  ,   0.56623787],
+       [ 85.16928   ,  88.88764   ,   0.5665537 ],
+       [ 61.65655   ,  89.35312   ,   0.4463089 ],
+       [ 80.01986   ,  91.51777   ,   0.30305162],
+       [ 70.90767   ,  89.90153   ,   0.48063472],
+       [ 78.70658   ,  97.33488   ,   0.39359188],
+       [ 68.3219    ,  97.67902   ,   0.41903985],
+       [ 80.69448   , 109.193985  ,   0.14496553],
+       [ 65.57641   , 105.08109   ,   0.27744702],
+       [ 79.44859   , 122.69015   ,   0.17710638],
+       [ 64.03736   , 120.170425  ,   0.46565098]], dtype=float32), 'kpt_score': 0.4905869}, {'coordinate': [7.081953, 80.3705, 46.81927, 161.72012], 'det_score': 0.6587498784065247, 'keypoints': array([[ 29.51531   ,  91.49908   ,   0.75517464],
+       [ 31.225754  ,  89.82169   ,   0.7765606 ],
+       [ 27.376017  ,  89.71614   ,   0.80448   ],
+       [ 33.515877  ,  90.82257   ,   0.7093001 ],
+       [ 23.521307  ,  90.84212   ,   0.777707  ],
+       [ 37.539314  , 101.381516  ,   0.6913692 ],
+       [ 18.340288  , 102.41546   ,   0.7203535 ],
+       [ 39.826218  , 113.37301   ,   0.5913918 ],
+       [ 16.857304  , 115.10882   ,   0.5492331 ],
+       [ 28.826103  , 121.861855  ,   0.39205936],
+       [ 22.47133   , 120.69003   ,   0.6120081 ],
+       [ 34.177963  , 126.15756   ,   0.5601723 ],
+       [ 21.39047   , 125.30078   ,   0.5064371 ],
+       [ 27.961575  , 133.33154   ,   0.54826814],
+       [ 22.303364  , 129.8608    ,   0.2293001 ],
+       [ 31.242027  , 153.047     ,   0.36292207],
+       [ 21.80127   , 153.78947   ,   0.30531448]], dtype=float32), 'kpt_score': 0.58188534}, {'coordinate': [126.131096, 30.263107, 168.5759, 134.09885], 'det_score': 0.6441988348960876, 'keypoints': array([[149.89236   ,  43.87846   ,   0.75441885],
+       [151.99484   ,  41.95912   ,   0.82070917],
+       [148.18002   ,  41.775055  ,   0.8453321 ],
+       [155.37967   ,  42.06968   ,   0.83349544],
+       [145.38167   ,  41.69159   ,   0.8233239 ],
+       [159.26329   ,  53.284737  ,   0.86246717],
+       [142.35178   ,  51.206886  ,   0.6940705 ],
+       [157.3975    ,  71.31917   ,   0.7624757 ],
+       [136.59795   ,  66.40522   ,   0.55612797],
+       [142.90988   ,  78.28269   ,   0.779243  ],
+       [135.43607   ,  73.9765    ,   0.5737738 ],
+       [155.7851    ,  82.44225   ,   0.6966109 ],
+       [143.4588    ,  80.91763   ,   0.60589534],
+       [153.45274   , 102.84818   ,   0.62720954],
+       [131.59738   ,  87.54947   ,   0.4976839 ],
+       [155.56401   , 125.58888   ,   0.5414401 ],
+       [139.57607   , 122.08866   ,   0.26570275]], dtype=float32), 'kpt_score': 0.67882234}, {'coordinate': [112.50212, 64.127, 150.35353, 125.85529], 'det_score': 0.5013833045959473, 'keypoints': array([[1.35197662e+02, 7.29378281e+01, 5.58694899e-01],
+       [1.36285202e+02, 7.16439133e+01, 6.38598502e-01],
+       [1.33776855e+02, 7.16437454e+01, 6.36756659e-01],
+       [1.37833389e+02, 7.24015121e+01, 4.13749218e-01],
+       [1.31340057e+02, 7.30362549e+01, 5.70683837e-01],
+       [1.42542435e+02, 8.28875885e+01, 2.30803847e-01],
+       [1.29773300e+02, 8.52729874e+01, 4.94463116e-01],
+       [1.41332916e+02, 9.43963928e+01, 9.36751068e-02],
+       [1.28858521e+02, 9.95147858e+01, 2.72373617e-01],
+       [1.44981277e+02, 7.83604965e+01, 8.68032947e-02],
+       [1.34379593e+02, 8.23366165e+01, 1.67876005e-01],
+       [1.37895874e+02, 1.08476562e+02, 1.58305198e-01],
+       [1.30837265e+02, 1.07525513e+02, 1.45044222e-01],
+       [1.31290604e+02, 1.02961494e+02, 7.68775940e-02],
+       [1.17951675e+02, 1.07433502e+02, 2.09531561e-01],
+       [1.29175934e+02, 1.14402641e+02, 1.46551579e-01],
+       [1.27901909e+02, 1.16773926e+02, 2.08665460e-01]], dtype=float32), 'kpt_score': 0.3005561}]}}
 ```
 </details></li></ul>
 

+ 3 - 1
paddlex/inference/models/keypoint_detection/result.py

@@ -15,11 +15,12 @@
 import cv2
 import copy
 import math
+from PIL import Image
 
 import matplotlib.pyplot as plt
 import numpy as np
 
-from ...common.result import BaseCVResult, StrMixin, JsonMixin
+from ...common.result import BaseCVResult, JsonMixin
 
 
 def get_color(idx):
@@ -177,6 +178,7 @@ class KptResult(BaseCVResult):
         image = self["input_img"]
         if keypoints:
             image = draw_keypoints(image, dict(keypoints=np.stack(keypoints)))
+        image = Image.fromarray(image[..., ::-1])
         return {"res": image}
 
     def _to_str(self, *args, **kwargs):

+ 28 - 2
paddlex/inference/models/object_detection/processors.py

@@ -55,9 +55,9 @@ class ReadImage(CommonReadImage):
                     )
                 data.update(raw_img)
                 raw_img = src_img
-            img = self.read(raw_img)
+            img, ori_img = self.read(raw_img)
             data["img"] = img
-            data["ori_img"] = img
+            data["ori_img"] = ori_img
             data["img_size"] = [img.shape[1], img.shape[0]]  # [size_w, size_h]
             data["ori_img_size"] = [img.shape[1], img.shape[0]]  # [size_w, size_h]
 
@@ -65,6 +65,32 @@ class ReadImage(CommonReadImage):
 
         return out_datas
 
+    def read(self, img):
+        if isinstance(img, np.ndarray):
+            ori_img = img
+            if self.format == "RGB":
+                img = img[:, :, ::-1]
+            return img, ori_img
+        elif isinstance(img, str):
+            blob = self._img_reader.read(img)
+            if blob is None:
+                raise Exception(f"Image read Error: {img}")
+
+            ori_img = blob
+            if self.format == "RGB":
+                if blob.ndim != 3:
+                    raise RuntimeError("Array is not 3-dimensional.")
+                # BGR to RGB
+                blob = blob[..., ::-1]
+            return blob, ori_img
+        else:
+            raise TypeError(
+                f"ReadImage only supports the following types:\n"
+                f"1. str, indicating a image file path or a directory containing image files.\n"
+                f"2. numpy.ndarray.\n"
+                f"However, got type: {type(img).__name__}."
+            )
+
 
 class Resize(CommonResize):
     def __call__(self, datas: List[dict]) -> List[dict]:

+ 1 - 1
paddlex/inference/models/object_detection/result.py

@@ -99,7 +99,7 @@ class DetResult(BaseCVResult):
     def _to_img(self) -> Image.Image:
         """apply"""
         boxes = self["boxes"]
-        image = Image.fromarray(self["input_img"])
+        image = Image.fromarray(self["input_img"][..., ::-1])
         return {"res": draw_box(image, boxes)}
 
     def _to_str(self, *args, **kwargs):

+ 5 - 1
paddlex/inference/pipelines/face_recognition/pipeline.py

@@ -12,6 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import numpy as np
+
 from ..pp_shitu_v2 import ShiTuV2Pipeline
 from .result import FaceRecResult
 
@@ -44,7 +46,9 @@ class FaceRecPipeline(ShiTuV2Pipeline):
     def get_final_result(self, input_data, raw_img, det_res, rec_res):
         single_img_res = {"input_path": input_data, "input_img": raw_img, "boxes": []}
         for i, obj in enumerate(det_res["boxes"]):
-            rec_scores = rec_res["score"][i].tolist()
+            rec_scores = rec_res["score"][i]
+            if isinstance(rec_scores, np.ndarray):
+                rec_scores = rec_scores.tolist()
             labels = rec_res["label"][i]
             single_img_res["boxes"].append(
                 {

+ 5 - 1
paddlex/inference/pipelines/pp_shitu_v2/pipeline.py

@@ -14,6 +14,8 @@
 
 from typing import Any, Dict, Optional
 
+import numpy as np
+
 from ...utils.pp_option import PaddlePredictorOption
 from ...common.reader import ReadImage
 from ...common.batch_sampler import ImageBatchSampler
@@ -103,7 +105,9 @@ class ShiTuV2Pipeline(BasePipeline):
     def get_final_result(self, input_data, raw_img, det_res, rec_res):
         single_img_res = {"input_path": input_data, "input_img": raw_img, "boxes": []}
         for i, obj in enumerate(det_res["boxes"]):
-            rec_scores = rec_res["score"][i].tolist()
+            rec_scores = rec_res["score"][i]
+            if isinstance(rec_scores, np.ndarray):
+                rec_scores = rec_scores.tolist()
             labels = rec_res["label"][i]
             single_img_res["boxes"].append(
                 {

+ 1 - 1
paddlex/inference/pipelines/pp_shitu_v2/result.py

@@ -108,7 +108,7 @@ class ShiTuResult(BaseCVResult):
             for box in self["boxes"]
             if box["rec_scores"] is not None
         ]
-        image = draw_box(self["input_img"], boxes)
+        image = draw_box(self["input_img"][..., ::-1], boxes)
         return {"res": image}
 
     def _to_str(self, *args, **kwargs):

+ 2 - 2
paddlex/utils/pipeline_arguments.py

@@ -93,7 +93,7 @@ PIPELINE_ARGUMENTS = {
     "object_detection": [
         {
             "name": "--threshold",
-            "type": float,
+            "type": custom_type(Optional[Union[float, dict[int, float]]]),
             "help": "Sets the threshold for object detection.",
         },
     ],
@@ -138,7 +138,7 @@ PIPELINE_ARGUMENTS = {
     "human_keypoint_detection": [
         {
             "name": "--det_threshold",
-            "type": float,
+            "type": custom_type(Optional[float]),
             "help": "Sets the threshold for human detection.",
         },
     ],