Commit 53d04942 authored by RyuShai's avatar RyuShai

add try catch on reference

parent b62cf801
This source diff could not be displayed because it is too large. You can view the blob instead.
/home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/assets/abc.txt /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/assets/NudeNet.onnx /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/assets/nude.jpg /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/fonts/MaterialIcons-Regular.otf /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/shaders/ink_sparkle.frag /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/AssetManifest.json /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/AssetManifest.bin /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/FontManifest.json /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/NOTICES.Z: /home/thangdm/Projects/Android/demo_nudedetector/pubspec.yaml /home/thangdm/Projects/Android/demo_nudedetector/assets/abc.txt /home/thangdm/Projects/Android/demo_nudedetector/assets/NudeNet.onnx /home/thangdm/Projects/Android/demo_nudedetector/assets/nude.jpg /home/thangdm/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.8/assets/CupertinoIcons.ttf /home/thangdm/Software/flutter_linux_3.19.6-stable/flutter/bin/cache/artifacts/material_fonts/MaterialIcons-Regular.otf /home/thangdm/Software/flutter_linux_3.19.6-stable/flutter/packages/flutter/lib/src/material/shaders/ink_sparkle.frag /home/thangdm/.pub-cache/hosted/pub.dev/async-2.11.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/characters-1.3.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/clock-1.1.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/collection-1.18.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.8/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/fake_async-1.3.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/ffi-2.1.2/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/leak_tracker-10.0.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-2.0.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/leak_tracker_testing-2.0.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/matcher-0.12.16+1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/material_color_utilities-0.8.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/meta-1.11.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/path-1.9.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/path_provider-2.1.3/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/path_provider_android-2.2.4/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/path_provider_platform_interface-2.1.2/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/permission_handler-11.3.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_android-12.0.7/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.5/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_platform_interface-4.2.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/platform-3.1.5/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/plugin_platform_interface-2.1.8/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/source_span-1.10.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/stack_trace-1.11.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/stream_channel-2.1.2/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/string_scanner-1.2.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/term_glyph-1.2.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/test_api-0.6.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/vector_math-2.1.4/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/vm_service-13.0.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/win32-5.5.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/xdg_directories-1.0.4/LICENSE /home/thangdm/Software/flutter_linux_3.19.6-stable/flutter/bin/cache/pkg/sky_engine/LICENSE /home/thangdm/Software/flutter_linux_3.19.6-stable/flutter/packages/flutter/LICENSE /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/assets/abc.txt /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/assets/NudeNet.onnx /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/assets/nude.jpg /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/fonts/MaterialIcons-Regular.otf /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/shaders/ink_sparkle.frag /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/AssetManifest.json /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/AssetManifest.bin /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/FontManifest.json /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/flutter/debug/flutter_assets/NOTICES.Z: /home/thangdm/Projects/Android/demo_nudedetector/pubspec.yaml /home/thangdm/Projects/Android/demo_nudedetector/assets/abc.txt /home/thangdm/Projects/Android/demo_nudedetector/assets/NudeNet.onnx /home/thangdm/Projects/Android/demo_nudedetector/assets/nude.jpg /home/thangdm/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.8/assets/CupertinoIcons.ttf /home/thangdm/Software/flutter_linux_3.19.6-stable/flutter/bin/cache/artifacts/material_fonts/MaterialIcons-Regular.otf /home/thangdm/Software/flutter_linux_3.19.6-stable/flutter/packages/flutter/lib/src/material/shaders/ink_sparkle.frag /home/thangdm/.pub-cache/hosted/pub.dev/async-2.11.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/characters-1.3.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/clock-1.1.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/collection-1.18.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.8/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/fake_async-1.3.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/ffi-2.1.3/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/leak_tracker-10.0.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-2.0.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/leak_tracker_testing-2.0.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/matcher-0.12.16+1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/material_color_utilities-0.8.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/meta-1.11.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/path-1.9.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/path_provider-2.1.4/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/path_provider_android-2.2.4/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/path_provider_platform_interface-2.1.2/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/permission_handler-11.3.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_android-12.0.12/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.5/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+2/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_platform_interface-4.2.3/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/platform-3.1.5/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/plugin_platform_interface-2.1.8/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/source_span-1.10.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/stack_trace-1.11.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/stream_channel-2.1.2/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/string_scanner-1.2.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/term_glyph-1.2.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/test_api-0.6.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/vector_math-2.1.4/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/vm_service-13.0.0/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/web-0.5.1/LICENSE /home/thangdm/.pub-cache/hosted/pub.dev/xdg_directories-1.0.4/LICENSE /home/thangdm/Software/flutter_linux_3.19.6-stable/flutter/bin/cache/pkg/sky_engine/LICENSE /home/thangdm/Software/flutter_linux_3.19.6-stable/flutter/packages/flutter/LICENSE
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// This file is generated from template in file `flutter_tools/lib/src/flutter_plugins.dart`. // This file is generated from template in file `flutter_tools/lib/src/flutter_plugins.dart`.
// //
// @dart = 3.5 // @dart = 3.3
import 'dart:io'; // flutter_ignore: dart_io_import. import 'dart:io'; // flutter_ignore: dart_io_import.
import 'package:path_provider_android/path_provider_android.dart'; import 'package:path_provider_android/path_provider_android.dart';
......
This diff is collapsed.
This diff is collapsed.
3.24.3 3.19.6
\ No newline at end of file \ No newline at end of file
# This is a generated file; do not edit or check into version control. # This is a generated file; do not edit or check into version control.
path_provider=/Users/aidenle/.pub-cache/hosted/pub.dev/path_provider-2.1.4/ path_provider=/home/thangdm/.pub-cache/hosted/pub.dev/path_provider-2.1.4/
path_provider_android=/Users/aidenle/.pub-cache/hosted/pub.dev/path_provider_android-2.2.10/ path_provider_android=/home/thangdm/.pub-cache/hosted/pub.dev/path_provider_android-2.2.4/
path_provider_foundation=/Users/aidenle/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.0/ path_provider_foundation=/home/thangdm/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.0/
path_provider_linux=/Users/aidenle/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/ path_provider_linux=/home/thangdm/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
path_provider_windows=/Users/aidenle/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/ path_provider_windows=/home/thangdm/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/
permission_handler=/Users/aidenle/.pub-cache/hosted/pub.dev/permission_handler-11.3.1/ permission_handler=/home/thangdm/.pub-cache/hosted/pub.dev/permission_handler-11.3.1/
permission_handler_android=/Users/aidenle/.pub-cache/hosted/pub.dev/permission_handler_android-12.0.12/ permission_handler_android=/home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_android-12.0.12/
permission_handler_apple=/Users/aidenle/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.5/ permission_handler_apple=/home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.5/
permission_handler_html=/Users/aidenle/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+2/ permission_handler_html=/home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+2/
permission_handler_windows=/Users/aidenle/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/ permission_handler_windows=/home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"/Users/aidenle/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.0/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"permission_handler_apple","path":"/Users/aidenle/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.5/","native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"/Users/aidenle/.pub-cache/hosted/pub.dev/path_provider_android-2.2.10/","native_build":true,"dependencies":[]},{"name":"permission_handler_android","path":"/Users/aidenle/.pub-cache/hosted/pub.dev/permission_handler_android-12.0.12/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"/Users/aidenle/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.0/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/aidenle/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/aidenle/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[]},{"name":"permission_handler_windows","path":"/Users/aidenle/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/","native_build":true,"dependencies":[]}],"web":[{"name":"permission_handler_html","path":"/Users/aidenle/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+2/","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_html","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_html","dependencies":[]},{"name":"permission_handler_windows","dependencies":[]}],"date_created":"2024-10-02 15:12:28.828252","version":"3.24.3","swift_package_manager_enabled":false} {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"/home/thangdm/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.0/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"permission_handler_apple","path":"/home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.5/","native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"/home/thangdm/.pub-cache/hosted/pub.dev/path_provider_android-2.2.4/","native_build":true,"dependencies":[]},{"name":"permission_handler_android","path":"/home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_android-12.0.12/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"/home/thangdm/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.0/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/home/thangdm/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/home/thangdm/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[]},{"name":"permission_handler_windows","path":"/home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/","native_build":true,"dependencies":[]}],"web":[{"name":"permission_handler_html","path":"/home/thangdm/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+2/","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_html","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_html","dependencies":[]},{"name":"permission_handler_windows","dependencies":[]}],"date_created":"2024-10-02 15:42:48.270897","version":"3.19.6"}
\ No newline at end of file \ No newline at end of file
...@@ -27,3 +27,5 @@ ...@@ -27,3 +27,5 @@
2 3459 1727840724 CMakeFiles/myapplicationnativec.dir/home/thangdm/Projects/Android/demo_nudedetector/c/src/detector/nudedetector.cpp.o df3859a7b1d41e8f 2 3459 1727840724 CMakeFiles/myapplicationnativec.dir/home/thangdm/Projects/Android/demo_nudedetector/c/src/detector/nudedetector.cpp.o df3859a7b1d41e8f
2 3049 1727840849 CMakeFiles/myapplicationnativec.dir/home/thangdm/Projects/Android/demo_nudedetector/native_c.cpp.o b2b3126708a77992 2 3049 1727840849 CMakeFiles/myapplicationnativec.dir/home/thangdm/Projects/Android/demo_nudedetector/native_c.cpp.o b2b3126708a77992
3049 3220 1727840849 /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/cxx/Debug/575f1b3a/obj/arm64-v8a/libmyapplicationnativec.so e2a9f883a2b28979 3049 3220 1727840849 /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/cxx/Debug/575f1b3a/obj/arm64-v8a/libmyapplicationnativec.so e2a9f883a2b28979
2 3106 1727858515 CMakeFiles/myapplicationnativec.dir/home/thangdm/Projects/Android/demo_nudedetector/native_c.cpp.o b2b3126708a77992
3106 3168 1727858515 /home/thangdm/Projects/Android/demo_nudedetector/build/app/intermediates/cxx/Debug/575f1b3a/obj/arm64-v8a/libmyapplicationnativec.so e2a9f883a2b28979
...@@ -2,87 +2,91 @@ ...@@ -2,87 +2,91 @@
#include <string> #include <string>
#include "c/src/detector/nudedetector.h" #include "c/src/detector/nudedetector.h"
#include <stdio.h> #include <stdio.h>
//#include <onnxruntime/onnxruntime_cxx_api.h> // #include <onnxruntime/onnxruntime_cxx_api.h>
//#include <opencv2/opencv.hpp> // #include <opencv2/opencv.hpp>
#define LOGR(x) __android_log_print(ANDROID_LOG_DEBUG, "flutter", x); #define LOGR(x) __android_log_print(ANDROID_LOG_DEBUG, "flutter", x);
struct StringArray { struct StringArray
const char** data; {
const char **data;
int size; int size;
}; };
extern "C" __attribute__((visibility("default"))) __attribute__((used)) extern "C" __attribute__((visibility("default"))) __attribute__((used))
int32_t native_add(int32_t x, int32_t y) { int32_t
// LOGR("test from c native_add") native_add(int32_t x, int32_t y)
return x+y; {
// LOGR("test from c native_add")
return x + y;
} }
extern "C" __attribute__((visibility("default"))) __attribute__((used)) extern "C" __attribute__((visibility("default"))) __attribute__((used)) float native_add_floats(float x, float y)
float native_add_floats(float x, float y) { {
// LOGR("test from c native_add_floats"); // LOGR("test from c native_add_floats");
return x + y; return x + y;
} }
extern "C" __attribute__((visibility("default"))) __attribute__((used)) extern "C" __attribute__((visibility("default"))) __attribute__((used)) bool native_compare_int(int32_t x, int32_t y)
bool native_compare_int(int32_t x, int32_t y) { {
// LOGR("test from c native_compare_int"); // LOGR("test from c native_compare_int");
return x == y; return x == y;
} }
extern "C" __attribute__((visibility("default"))) __attribute__((used)) extern "C" __attribute__((visibility("default"))) __attribute__((used))
const wchar_t* native_get_wstring(const wchar_t* input) { const wchar_t *
native_get_wstring(const wchar_t *input)
{
static std::wstring result; static std::wstring result;
result = input; result = input;
result += L" hello world"; result += L" hello world";
return result.c_str(); return result.c_str();
} }
extern "C" extern "C" void test()
void test() { {
printf("hello mon"); printf("hello mon");
} }
NudeDetector *nudeEngine = new NudeDetector; NudeDetector *nudeEngine = new NudeDetector;
extern "C" __attribute__((visibility("default"))) __attribute__((used)) extern "C" __attribute__((visibility("default"))) __attribute__((used)) void init_engine(const char *modelPath, const char *documentsPath)
void init_engine(const char* modelPath, const char* documentsPath) { {
// nudeEngine->modelPath = "/storage/emulated/0/Models/Yolov8/NudeNet/NudeNet.onnx"; // nudeEngine->modelPath = "/storage/emulated/0/Models/Yolov8/NudeNet/NudeNet.onnx";
nudeEngine->modelPath = modelPath; nudeEngine->modelPath = modelPath;
// nudeEngine->modelPath = "/assets/nudenet.onnx"; // nudeEngine->modelPath = "/assets/nudenet.onnx";
//"/private/var/containers/Bundle/Application/C3250AEF-83D8-4121-918F-7B8142F91B36/Runner.app/NudeNet.onnx"; //"/private/var/containers/Bundle/Application/C3250AEF-83D8-4121-918F-7B8142F91B36/Runner.app/NudeNet.onnx";
nudeEngine->numThread = 1; nudeEngine->numThread = 1;
nudeEngine->modelShape = cv::Size(320,320); nudeEngine->modelShape = cv::Size(320, 320);
nudeEngine->inputNodeDims = {1,3,320,320}; nudeEngine->inputNodeDims = {1, 3, 320, 320};
nudeEngine->objectThreshold = 0.2; nudeEngine->objectThreshold = 0.2;
nudeEngine->InitEngine(); nudeEngine->InitEngine();
// LOGR("init engine done"); // LOGR("init engine done");
LOG_C("documentsPath: " << documentsPath);
// cv::imwrite(documentsPath, drawing);
LOG_C("documentsPath: " <<documentsPath);
// cv::imwrite(documentsPath, drawing);
auto firstBlood = CURRENT_MILIS; auto firstBlood = CURRENT_MILIS;
// LOGR("first blood: " + std::to_string(CURRENT_MILIS - firstBlood)); // LOGR("first blood: " + std::to_string(CURRENT_MILIS - firstBlood));
auto start = CURRENT_MILIS; auto start = CURRENT_MILIS;
uint total=0; uint total = 0;
// for(uint i=0; i < 100 ; i++){ // for(uint i=0; i < 100 ; i++){
// nudeEngine->InferenceEngine(nudeImage); // nudeEngine->InferenceEngine(nudeImage);
// total += CURRENT_MILIS-start; // total += CURRENT_MILIS-start;
// start = CURRENT_MILIS; // start = CURRENT_MILIS;
// } // }
// LOGR("average process time: " + std::to_string(total/100) + "ms"); // LOGR("average process time: " + std::to_string(total/100) + "ms");
//LOGR("finished") // LOGR("finished")
} }
extern "C" __attribute__((visibility("default"))) __attribute__((used)) extern "C" __attribute__((visibility("default"))) __attribute__((used)) void init_engine2()
void init_engine2() { {
// LOGR("init engine 2"); // LOGR("init engine 2");
nudeEngine->modelPath = "./assets/NudeNet.onnx"; nudeEngine->modelPath = "./assets/NudeNet.onnx";
nudeEngine->numThread = 1; nudeEngine->numThread = 1;
nudeEngine->modelShape = cv::Size(320,320); nudeEngine->modelShape = cv::Size(320, 320);
nudeEngine->inputNodeDims = {1,3,320,320}; nudeEngine->inputNodeDims = {1, 3, 320, 320};
nudeEngine->objectThreshold = 0.2; nudeEngine->objectThreshold = 0.2;
nudeEngine->InitEngine(); nudeEngine->InitEngine();
// LOGR("init engine done"); // LOGR("init engine done");
...@@ -91,39 +95,50 @@ void init_engine2() { ...@@ -91,39 +95,50 @@ void init_engine2() {
auto firstBlood = CURRENT_MILIS; auto firstBlood = CURRENT_MILIS;
std::vector<NudeDetector::NudeInfo> nude_info = nudeEngine->InferenceEngine(nudeImage); std::vector<NudeDetector::NudeInfo> nude_info = nudeEngine->InferenceEngine(nudeImage);
auto start = CURRENT_MILIS; auto start = CURRENT_MILIS;
uint total=0; uint total = 0;
// for(uint i=0; i < 100 ; i++){ // for(uint i=0; i < 100 ; i++){
// nudeEngine->InferenceEngine(nudeImage); // nudeEngine->InferenceEngine(nudeImage);
// total += CURRENT_MILIS-start; // total += CURRENT_MILIS-start;
// start = CURRENT_MILIS; // start = CURRENT_MILIS;
// } // }
// LOGR("average process time: " + std::to_string(total/100) + "ms"); // LOGR("average process time: " + std::to_string(total/100) + "ms");
// LOGR("finished") // LOGR("finished")
} }
// must call after init_engine // must call after init_engine
extern "C" __attribute__((visibility("default"))) __attribute__((used)) extern "C" __attribute__((visibility("default"))) __attribute__((used))
StringArray get_insentive_class_info(const char* imgPath) { StringArray
get_insentive_class_info(const char *imgPath)
{
cv::Mat nudeImage = cv::imread(imgPath); cv::Mat nudeImage = cv::imread(imgPath);
std::vector<NudeDetector::NudeInfo> nudeInfos = nudeEngine->InferenceEngine(nudeImage); try
{
char* results[] = {}; std::vector<NudeDetector::NudeInfo> nudeInfos = nudeEngine->InferenceEngine(nudeImage);
char *results[] = {};
// for (auto i: nudeInfos) // for (auto i: nudeInfos)
// results.push_back(i.className); // results.push_back(i.className);
const char** c_strings = (const char**)malloc(nudeInfos.size() * sizeof(char*)); const char **c_strings = (const char **)malloc(nudeInfos.size() * sizeof(char *));
for (int i = 0; i < nudeInfos.size(); ++i) { for (int i = 0; i < nudeInfos.size(); ++i)
c_strings[i] = strdup(nudeInfos[i].className.c_str()); // Duplicate strings into C-style char arrays {
} c_strings[i] = strdup(nudeInfos[i].className.c_str()); // Duplicate strings into C-style char arrays
}
return {c_strings, static_cast<int>(nudeInfos.size())}; return {c_strings, static_cast<int>(nudeInfos.size())};
}
catch (...)
{
return StringArray();
}
} }
void free_string_array(StringArray arr) { void free_string_array(StringArray arr)
for (int i = 0; i < arr.size; ++i) { {
free((void*)arr.data[i]); // free individual strings for (int i = 0; i < arr.size; ++i)
{
free((void *)arr.data[i]); // free individual strings
} }
free(arr.data); // free the array itself free(arr.data); // free the array itself
} }
\ No newline at end of file
...@@ -84,26 +84,26 @@ packages: ...@@ -84,26 +84,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.0.5" version: "10.0.0"
leak_tracker_flutter_testing: leak_tracker_flutter_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_flutter_testing name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.5" version: "2.0.1"
leak_tracker_testing: leak_tracker_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_testing name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.1" version: "2.0.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
...@@ -116,18 +116,18 @@ packages: ...@@ -116,18 +116,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.11.1" version: "0.8.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.15.0" version: "1.11.0"
path: path:
dependency: transitive dependency: transitive
description: description:
...@@ -148,10 +148,10 @@ packages: ...@@ -148,10 +148,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: path_provider_android name: path_provider_android
sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.10" version: "2.2.4"
path_provider_foundation: path_provider_foundation:
dependency: transitive dependency: transitive
description: description:
...@@ -297,10 +297,10 @@ packages: ...@@ -297,10 +297,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.2" version: "0.6.1"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
...@@ -313,18 +313,18 @@ packages: ...@@ -313,18 +313,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vm_service name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "14.2.5" version: "13.0.0"
web: web:
dependency: transitive dependency: transitive
description: description:
name: web name: web
sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.0" version: "0.5.1"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:
...@@ -334,5 +334,5 @@ packages: ...@@ -334,5 +334,5 @@ packages:
source: hosted source: hosted
version: "1.0.4" version: "1.0.4"
sdks: sdks:
dart: "3.5.3" dart: "3.3.4"
flutter: ">=3.22.0" flutter: ">=3.16.6"
...@@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev ...@@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: '3.5.3' sdk: '3.3.4'
# Dependencies specify other packages that your package needs in order to work. # Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions # To automatically upgrade your package dependencies to the latest versions
......
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