Эх сурвалжийг харах

add alias in pdx.seg and pdx.det

will-jl944 4 жил өмнө
parent
commit
45254a9034

+ 0 - 6
dygraph/paddlex/cls.py

@@ -15,12 +15,6 @@
 from . import cv
 from paddlex.cv.transforms import cls_transforms
 
-
-def __getattr__(attr):
-    if attr == 'transforms':
-        print("You are using PaddleX 1.x API")
-
-
 transforms = cls_transforms
 
 ResNet18 = cv.models.ResNet18

+ 9 - 5
dygraph/paddlex/det.py

@@ -12,12 +12,16 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from . import cv
+from .cv.models.utils.visualize import visualize_detection, draw_pr_curve
 from paddlex.cv.transforms import det_transforms
 
+transforms = det_transforms
 
-def __getattr__(attr):
-    if attr == 'transforms':
-        print("You are using PaddleX 1.x API")
-
+FasterRCNN = cv.models.FasterRCNN
+YOLOv3 = cv.models.YOLOv3
+PPYOLO = cv.models.PPYOLO
+MaskRCNN = cv.models.MaskRCNN
 
-transforms = det_transforms
+visualize = visualize_detection
+draw_pr_curve = draw_pr_curve

+ 8 - 5
dygraph/paddlex/seg.py

@@ -12,12 +12,15 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from . import cv
+from .cv.models.utils.visualize import visualize_segmentation
 from paddlex.cv.transforms import seg_transforms
 
+transforms = seg_transforms
 
-def __getattr__(attr):
-    if attr == 'transforms':
-        print("You are using PaddleX 1.x API")
-
+UNet = cv.models.UNet
+DeepLabv3p = cv.models.DeepLabV3P
+HRNet = cv.models.HRNet
+FastSCNN = cv.models.FastSCNN
 
-transforms = seg_transforms
+visualize = visualize_segmentation