mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-20 10:57:45 +08:00
feat: use VisionOCR for apple platform
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
||||
[submodule "test"]
|
||||
path = test
|
||||
url = https://github.com/MaaAssistantArknights/MaaTestSet.git
|
||||
[submodule "3rdparty/VisionOCR"]
|
||||
path = 3rdparty/VisionOCR
|
||||
url = https://github.com/hguandl/VisionOCR.git
|
||||
|
||||
1
3rdparty/VisionOCR
vendored
Submodule
1
3rdparty/VisionOCR
vendored
Submodule
Submodule 3rdparty/VisionOCR added at cd18ce5e00
@@ -55,7 +55,17 @@ else ()
|
||||
target_link_libraries(MeoAssistant range-v3::range-v3)
|
||||
endif ()
|
||||
|
||||
target_link_libraries(MeoAssistant ppocr paddle_inference protobuf cryptopp gflags glog utf8proc xxhash iomp5 mkldnn mklml_intel)
|
||||
if (APPLE)
|
||||
add_subdirectory(3rdparty/VisionOCR)
|
||||
target_link_libraries(MeoAssistant
|
||||
vnocr
|
||||
"-framework CoreFoundation"
|
||||
"-framework CoreGraphics"
|
||||
"-framework Vision"
|
||||
)
|
||||
else ()
|
||||
target_link_libraries(MeoAssistant ppocr paddle_inference protobuf cryptopp gflags glog utf8proc xxhash iomp5 mkldnn mklml_intel)
|
||||
endif (APPLE)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${PROJECT_SOURCE_DIR}/3rdparty/include")
|
||||
endif ()
|
||||
|
||||
@@ -34,6 +34,10 @@ class Asst:
|
||||
Asst.__libpath = pathlib.Path(path) / 'MeoAssistant.dll'
|
||||
os.environ["PATH"] += os.pathsep + str(path)
|
||||
Asst.__lib = ctypes.WinDLL(str(Asst.__libpath))
|
||||
if platform.system().lower() == 'darwin':
|
||||
Asst.__libpath = pathlib.Path(path) / 'libMeoAssistant.dylib'
|
||||
os.environ['DYLD_LIBRARY_PATH'] += os.pathsep + str(path)
|
||||
Asst.__lib = ctypes.CDLL(str(Asst.__libpath))
|
||||
else:
|
||||
Asst.__libpath = pathlib.Path(path) / 'libMeoAssistant.so'
|
||||
os.environ['LD_LIBRARY_PATH'] += os.pathsep + str(path)
|
||||
|
||||
Reference in New Issue
Block a user