malcev Posted December 8, 2022 Share Posted December 8, 2022 On 2/12/2022 at 1:09 PM, smbape said: I have not looked at the source code of mediapipe. If the python binding is also manually written, it will be a problem similar to dlib. If You are interested here is dll https://github.com/HW140701/GoogleMediapipePackageDll Link to comment Share on other sites More sharing options...
smbape Posted December 17, 2022 Author Share Posted December 17, 2022 Thanks @malcev I saw that project but I was not satisfied. I wrote a mediapipe binding that is similar to the python binding. It is not published yet because it is in the testing phase. Once done, it will be published. malcev 1 Link to comment Share on other sites More sharing options...
smbape Posted February 19, 2023 Author Share Posted February 19, 2023 Update opencv to 4.7.0 COM Registration is no longer required malcev, Danyfirex and DoVinhTrung 3 Link to comment Share on other sites More sharing options...
mLipok Posted February 19, 2023 Share Posted February 19, 2023 @smbape can you move developing your UDF to github ? I think then we can start involving. Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
mLipok Posted February 19, 2023 Share Posted February 19, 2023 oops. Is it here:https://github.com/smbape/node-autoit-opencv-com ? Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
malcev Posted February 22, 2023 Share Posted February 22, 2023 smbape, I think You have bug here: $sManifest = EnvGet("OPENCV_ACTCTX_MANIFEST") https://github.com/smbape/node-autoit-opencv-com/blob/main/autoit-opencv-com/udf/opencv_udf.au3#L123 Why user will have this environment variable? May be it is easier just use direct path to manifest? Link to comment Share on other sites More sharing options...
smbape Posted February 25, 2023 Author Share Posted February 25, 2023 Hi @malcev The environment variable is intended to override the embeded manifest. It is not needed for scripting languages, but for compiled languages. That being said, I kept it just in case. For example, to use registration-free COM at compile time for opencv and mediapipe, the manifest used for activation context must have all the dependencies. Since each of the libraries has its own manifest, environment varaibles are a way to reduce the complexity of specifying a manifest per library. The following manisfest was put in a file <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity type="win32" name="mediapipe.sxs" version="0.3.0.0" /> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="autoit_opencv_com470.sxs" version="2.3.1.0" /> </dependentAssembly> </dependency> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="autoit_mediapipe_com-0.9.1-470.sxs" version="0.3.0.0" /> </dependentAssembly> </dependency> </assembly> and the environment variables point to that file, like in this c# example https://github.com/smbape/node-autoit-mediapipe-com/blob/main/autoit-mediapipe-com/test/test.cs#L242 malcev and Danyfirex 2 Link to comment Share on other sites More sharing options...
malcev Posted February 26, 2023 Share Posted February 26, 2023 Thank You for explanation. Can We activate manifest only 1 time at start with DllActivateManifest, and deactivate it only before exit script with DllDeactivateActCtx? Can be some memory leaks? Also if We exit script without calling DllDeactivateActCtx, will be some memory leaks? Link to comment Share on other sites More sharing options...
smbape Posted February 26, 2023 Author Share Posted February 26, 2023 I thought about it, but there are cases where the current activation context changes and that's because the activation contexts are per thread. When a callback registered with DllCallbackRegister is called, the activation context changes. Therefore, creating objects (in a c++ method or in autoit) will no longer work since the current activation context is not the one that contains the information about the COM objects. There is also the case where different activation contexts are needed for different objects. For example if you use opencv and mediapipe at the same time. To handle such a case, the manifest used for activation must have all dependencies, i.e. opencv and mediapipe. But this is not enough, because the use in callbacks will not work. From Microsoft about Isolating Components Quote Well-authored components do not perturb the environment of the hosting application, nor do they leak activation contexts. Well-authored components perform their own context management rather than relying on the hosting application's environment. Activating before creating an object (_OpenCV_ObjCreate) or before calling a method/property (c++ GetTypeInfo/GetIDsOfNames/Invoke) ensures that the library objects always work. Deactivating the context ensures that the library does not perturb the the environment of the hosting application. malcev 1 Link to comment Share on other sites More sharing options...
smbape Posted February 26, 2023 Author Share Posted February 26, 2023 1 hour ago, malcev said: Can be some memory leaks? I don't understand the question. What makes you think of memory leaks. 1 hour ago, malcev said: Also if We exit script without calling DllDeactivateActCtx, will be some memory leaks? No, when your script dies, the memory associated with your script dies too. Perhaps you mean something else. Link to comment Share on other sites More sharing options...
skijve Posted March 10, 2023 Share Posted March 10, 2023 Thx for the work. At first sight, it seems soooo complicated to install :-) Link to comment Share on other sites More sharing options...
primetime Posted June 27, 2023 Share Posted June 27, 2023 Dunno if you'll ever read this, but I wanted to let you know that I'm testing this out and so far it's looking really great - wanted to commend you for the hard work on this - very incredible stuff, kudos! smbape 1 Link to comment Share on other sites More sharing options...
eumarcelino Posted July 10, 2023 Share Posted July 10, 2023 is there any way to run this compiled project on x86 systems? Link to comment Share on other sites More sharing options...
smbape Posted July 11, 2023 Author Share Posted July 11, 2023 There is no prebuilt opencv 32 bit. If you really need it, you have to compile opencv and the com library for 32bit yourself. Link to comment Share on other sites More sharing options...
konya Posted May 22 Share Posted May 22 Share some information : Bitmap to mat : $cv.createMatFromBitmap($hImage2_o) Resolve other language code page path issue : Local $STextHex = StringToBinary($_MODEL_FILE,1) Local $tString = DllStructCreate("byte txt[" & BinaryLen($STextHex) & "]") $tString.txt = $STextHex Local $stringcc = _WinAPI_MultiByteToWideChar($tString, 1252, Default, True) Local $base_options = $autoit.BaseOptions(_Mediapipe_Params("model_asset_path", $stringcc)) Link to comment Share on other sites More sharing options...
smbape Posted May 23 Author Share Posted May 23 Thanks @konya Can you give more information, a test case for example, about the code page path issue? I would have tough that Local $base_options = $autoit.BaseOptions(_Mediapipe_Params("model_asset_path", $_MODEL_FILE)) would have worked. Link to comment Share on other sites More sharing options...
konya Posted May 25 Share Posted May 25 (edited) When I use chinese path open image or mediapipe ,it is will crash,convet code page to 1252 resolve issue. $_MODEL_FILE = "c:\測試\test.jpg" Local $STextHex = StringToBinary($_MODEL_FILE,1) Local $tString = DllStructCreate("byte txt[" & BinaryLen($STextHex) & "]") $tString.txt = $STextHex Local $stringcc = _WinAPI_MultiByteToWideChar($tString, 1252, Default, True) Edited May 28 by konya Link to comment Share on other sites More sharing options...
smbape Posted June 30 Author Share Posted June 30 Update OpenCV to 4.10.0 Link to comment Share on other sites More sharing options...
smbape Posted June 30 Author Share Posted June 30 @konya There was actually a bug with non ascii strings. I have tested language detector with mediapipe without issues. Could you please retry with the new version without your workaround and tell me if it solves your issue? Danyfirex 1 Link to comment Share on other sites More sharing options...
konya Posted July 12 Share Posted July 12 (edited) @smbape I'm have test new version but cant load dll,so still use old version 4.7.0 ,it is stable. Edited July 12 by konya Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now