Переглянути джерело

Adapt to new type (#2998)

* add 3 pipelines serve

* fix sth

* add docs for 6 pipelines

* fix docs

* adapt ovd & ovs to new type
Zhang Zelun 9 місяців тому
батько
коміт
1fa7430e38

+ 2 - 2
paddlex/inference/models/open_vocabulary_detection/predictor.py

@@ -94,8 +94,8 @@ class OVDetPredictor(BasicPredictor):
             dict: A dictionary containing the input path, raw image, class IDs, scores, and label names
                 for every instance of the batch. Keys include 'input_path', 'input_img', 'class_ids', 'scores', and 'label_names'.
         """
-        image_paths = batch_data
-        src_images = self.pre_ops[0](batch_data)
+        image_paths = batch_data.input_paths
+        src_images = self.pre_ops[0](batch_data.instances)
         datas = src_images
         # preprocess
         for pre_op in self.pre_ops[1:-1]:

+ 2 - 2
paddlex/inference/models/open_vocabulary_segmentation/predictor.py

@@ -90,8 +90,8 @@ class OVSegPredictor(BasicPredictor):
             dict: A dictionary containing the input path, raw image, class IDs, scores, and label names
                 for every instance of the batch. Keys include 'input_path', 'input_img', 'class_ids', 'scores', and 'label_names'.
         """
-        image_paths = batch_data
-        src_images = self.pre_ops[0](batch_data)
+        image_paths = batch_data.input_paths
+        src_images = self.pre_ops[0](batch_data.instances)
         datas = src_images
         # preprocess
         for pre_op in self.pre_ops[1:-1]: