Skip to content

Commit

Permalink
Revert "remove iOS support"
Browse files Browse the repository at this point in the history
This reverts commit ff16c13.
  • Loading branch information
skyline75489 committed Dec 13, 2024
1 parent ff16c13 commit 69e438a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -663,14 +663,13 @@ if(OCOS_ENABLE_VISION)
if(WIN32)
# Use WIC on Windows. Nothing to be done
set(_DEFAULT_CODEC_ENABLE OFF)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") # OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(_DEFAULT_CODEC_ENABLE OFF)
# for iOS, it reports Undefined symbols for architecture x86_64: "_kUTTypeJPEG", which requires more work to fix.
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
# Use ImageIO on Apple platforms
set(_DEFAULT_CODEC_ENABLE OFF)
set(_APPLE_FRAMEWORKS "-framework CoreFoundation" "-framework CoreGraphics" "-framework ImageIO" "-framework CoreServices")
# if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
# list(APPEND _APPLE_FRAMEWORKS "-framework MobileCoreServices")
# endif()
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
list(APPEND _APPLE_FRAMEWORKS "-framework MobileCoreServices")
endif()
target_link_libraries(ocos_operators PRIVATE ${_APPLE_FRAMEWORKS})
endif()
endif()
Expand Down
4 changes: 2 additions & 2 deletions test/test_tools_add_pre_post_processing_to_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def test_draw_box_crop_pad(self):
create_boxdrawing_model.create_model(output_model, is_crop=is_crop)
image_ref = np.frombuffer(load_image_file(output_img), dtype=np.uint8)
output = self.draw_boxes_on_image(output_model, test_boxes[idx])
self.assertLess(compare_two_images_mse(image_ref, output), 0.2)
self.assertLess(compare_two_images_mse(image_ref, output), 0.13)

def test_draw_box_share_border(self):
import sys
Expand Down Expand Up @@ -1018,7 +1018,7 @@ def test_FastestDet(self):
# output.tofile(str(output_img) + "actual.png")

image_ref = np.frombuffer(load_image_file(output_img), dtype=np.uint8)
self.assertLess(compare_two_images_mse(image_ref, output), 0.2)
self.assertLess(compare_two_images_mse(image_ref, output), 0.1)


if __name__ == "__main__":
Expand Down

0 comments on commit 69e438a

Please sign in to comment.