Unverified Commit e4074828 authored by Xiaomeng Zhao's avatar Xiaomeng Zhao Committed by GitHub
Browse files

Merge pull request #1957 from myhloli/dev

refactor(magic_pdf): remove unnecessary half() calls for CPU devices
parents 5a3283c8 27281c92
......@@ -4,8 +4,6 @@ from doclayout_yolo import YOLOv10
class DocLayoutYOLOModel(object):
def __init__(self, weight, device):
self.model = YOLOv10(weight)
if not device.startswith("cpu"):
self.model.half()
self.device = device
def predict(self, image):
......
......@@ -4,8 +4,6 @@ from ultralytics import YOLO
class YOLOv8MFDModel(object):
def __init__(self, weight, device="cpu"):
self.mfd_model = YOLO(weight)
if not device.startswith("cpu"):
self.mfd_model.half()
self.device = device
def predict(self, image):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment