Convert custom tiny-YOLOv3 to a tensorflow format - deep-learning

After having tried all solutions I have found on every github, I couldn't find a way to convert a customly trained YOLOv3 from darknet to a tensorflow format (keras, tensorflow, tflite)
By custom I mean:
I changed the number of class to 1
I set the image size to 576x576
I set the number of channels to 1 (grayscale images)
So far I am happy with the results on darknet, but for my application I need TFlite and I can't find working method for conversion that suits my case.
Anyone have succeed in doing something similar?
Thank you.

Do you have the resulting .weights file for your custom model?
If so, the following project by peace195 may help:
https://github.com/peace195/tensorflow-lite-YOLOv3
EDIT:
In the above link, use convert_weights_pb.py file to convert your .weights file to a .pb file.
Then use the .pb file as a saved model and convert it to a .tflite model using the following command.
tflite_convert --saved_model_dir=saved_model/ --output_file yolo_v3.tflite --saved_model_signature_key='predict'
Thanks Anton Menshov for your suggestion on improving the answer.

This is the most simplest and easy repo. Author has done a wonderful job and it works well with yolov3, yolv3-tiny and yolov-4. Please don't forget to change the coco.names under classes if you are training on custom classes.
Git link for the code

Related

Autodesk-Forge configurator live sample with geometry change

I want to build enterprise solution for configurator base on Autodesk Inventor models and drawings. I want to have ability to change dimension of assembly (witdh, depth, length and another). I want to see changes on model in real time (something like here but with changes dimensions in custom values: https://tylko.com/shelf/bookcases/1429438/?cv=0&board=cat_all__type_all__id_4267)
As a result I want to have fully documented model with drawings.
Can Forge do that? Is there any demo?
Yes, here's a sample application that does something similar.
https://forge-rimconfigurator-inventor.herokuapp.com/
You can find the source code of the above application here:
https://github.com/sajith-subramanian/forge-rimconfigurator-inventor
There also is another intricate sample available. You can find it here:
http://inventor-config-demo.autodesk.io/
The source code of the above sample is available here:
https://github.com/Autodesk-Forge/forge-configurator-inventor
Thank you for response. Provided samples are different than:
https://tylko.com/shelf/bookcases/1429438/?cv=0&board=cat_all__type_all__id_4267
My sample is dynamic. Is there a possibility to not wait for change update. Same as you can see change directly in Inventor.

Is there an example of how to do a XAdES-BES enveloped signature with the XAdES4j library?

I'm trying to use the XAdES4j library to sign xml with an enveloped signature. From everything I've read it looks like it is possible to do exactly what I'd like to do, but I've not been able to find a simple example to help me to understand the workflow better. The library is found here:
https://github.com/luisgoncalves/xades4j
It includes a wiki, but the wiki does not give a clear example. It refers you to the unit tests in the code. However, in the code for the unit tests, there are numerous methods that do not exist in the main code stream. I'm looking for a simple example for a XAdES-BES enveloping signature to be added to xml given these variables:
The path to my xml file: /path/to/xml/myXmlFile.xml
The root element in my xml file: invoice
The path to my cert: /path/to/cert/myCert.p12
Password to my cert: "myPassword"
Can anybody help me out with a clear example?
Thanks so much in advance :)
Here's a full example provided by another user within an issue in GitHub. It illustrates both XAdES-BES and XAdES-T.
On the project's wiki you have detail instructions on which classes need to be used and pointers to more detailed information.
Regarding the unit tests, there are some common/helper methods on the base classes that can be useful in other scenarios, namely on SignatureServicesTestBase and SignerTestBase
Hope this helps.

Class file editor : Source not found error for ILock, ClassPathSuite classes

I am getting Class file editor : Source not found error for the classes in junit / hazelcast packages. Previously i got this error for all built in java classes. But after adding the Source zip file, i am able to see String.class and all. What i need to do for these classes. Please find the screenshot
Thanks in Advance!
Interestingly enough, your question contains all the concepts you need to know in order to answer it.
In order for your IDE to show you source code for any library you are using, the corresponding library needs to come with source code attached to it.
In other words: you managed to point your IDE to the ZIP file containing the source code for your JRE/JDK - thus your IDE knows what to show you when want to open up String.class
Now it seems that you are using other libraries as well. Maybe maybe, other libraries, have other, different source code ZIP files?!
Long story short: you need to add "source code" ZIPs for each and any additional library you are using and that you want to "peek into".
Within eclipse, you achieve that for example as described in that SO q/a. Side note: that is also something to keep in mind: you should do prior research before coming up with "new" questions. Especially when you are a beginner, you can be very sure that "your" question was asked here before.

Uploading a file using TCL

I'm a newbie working on OpenACS architecture and need to upload a .xml file through TCL. I went through the documentation and tried to work around with the code mentioned here: http://wiki.tcl.tk/13675
However, I'm unable to understand the code and the copy-paste won't work. Could someone please suggest a easier working way to upload a file in TCL? A working code would be of great help.
I need to upload a file through a HTTP form(with input type file parameter) and I'm asking for server-side code.
OpenACS already has file uploading built in (assuming you're using the OpenACS form builder aka ad_form, template::form - it has many names!). The specific widget you need to use is template::widget::file
A worked example is in the General Comments package (see file-ae.adp, file-add.tcl and file-add-2.tcl):
http://cvs.openacs.org/browse/OpenACS/openacs-4/packages/general-comments/www/file-ae.adp?r=1.6
http://cvs.openacs.org/browse/OpenACS/openacs-4/packages/general-comments/www/file-add.tcl?r=1.4
http://cvs.openacs.org/browse/OpenACS/openacs-4/packages/general-comments/www/file-add-2.tcl?r=1.6
Specifically, look out for the 2 ad_page_contract parameters, and follow those variables down through the code:
upload_file:notnull
upload_file.tmpfile:tmpfile
Re-inventing network protocols is not so much worth in most cases, so I'd like to recommend using proven community libs. From my personal experience, I'm pretty glad to deal with libcurl (see http://curl.haxx.se/libcurl/tcl)

Tesseract: Specifying regions of text

I'm using tesseract-ocr-3.01 to scan many forms. The forms all follow a template, so I already know where the regions/rectangles of text are.
Is there a way to pass those regions to tesseract when using the command-line tool?
I found the answer, thanks to this thread.
It seems that tesseract suports the uzn format (used in the unvl tests).
From the thread:
Calling tesseract with parameter "-psm 4" and renaming the uzn file
with the same name of the image seem works.
Example: If we have C:\input.tif and C:\input.uzn, we do this:
tesseract -psm 4 C:\input.tif C:\output
This may not be an optimal answer, but here goes:
I'm not sure whether the command-line tool has options to specify text-regions.
What you can do is use a Tesseract wrapper on another platform (EmguCV has Tesseract built-in). So you get the the scanned image, crop out the text-regions, and give them to Tesseract one-at-a-time. This way you'll also avoid any inaccuracies in Tesseract's page-layout analysis.
eg.
Image<Gray,Byte> scannedImage = new Image<Gray,Byte>(path_to_scanned_image);
//assuming you know a text region
Image<Gray,Byte> textRegion = new Image(100,20);
scannedImage.ROI = new Rectangle(0,0,100,20);
scannedImage.copyTo(textRegion);
ocr.recognize(textRegion);