Annotating images with text for deep learning + NLP - deep-learning

I am looking for a way to label document images and at the same time annotate the text that is inside the bounding boxes. Do you know anything to do this task?
(I have the coordinates of the image text obtained by Google-vision-API response)
thanks!

You can use annotation tools like: PPOCRLabel. This is a semi-automatic tool means it will auto-generate the text and you can edit them later.

Related

How can I use the AllenNLP framework to embed a label?

Just like using "textfieldembedder" to embed "textfieldtensors", I want to embed labels and convert them into tensors with the same dimension as embedded input texts.
Do you know about LabelField? Just put the appropriate LabelFields into your instances, and AllenNLP will add the labels to the vocabulary for you. When Model.__init__() runs, you can query the size of the label namespace to find out how big to make your embedding matrix.
Just create a normal torch.nn.Embedding in your model, and as Dirk suggests, set its size based on the vocabulary's size for the label field during Model.__init__.

gizmo based on Three.js is not visible

I created Forge viewer app w/ Transformation Extension based on GitHub sample "forge-extensions", for unknown reason, gizmo is not visible after I click on element, only very small yellow dot after zoom in, I believe it's element center point and gizmo size is too small, so my question is how to control it? in fact, all the coding is copied from that GitHub sample "forge-extensions", I must miss something simple!
Have you tried your code with different types of models, and does it behave the same for all of them? I believe it may have something to do with the scale of the particular model, especially when looking at these lines of code from the viewer extension:
_transformControlTx.setSize(
bbox.getBoundingSphere().radius * 5);
Try and put a breakpoint there, and see what the radius is. Or try adjusting the hard-coded value.

memory management for updating dynamic texts

what's better for memory and process?
1- one dynamic text and update it each second with:
this.t1.text = "Time: " + String(tin);
2- or have one static text and one dynamic text that updates with:
this.t1.text = String(tin);
Memory usage is more important than file size.
Don't worry about increasing file size for increasing performance. That's right decision.
I mean, the second one is better. Yeah, needs a little more work but it's good.
And an important point for that. If you're not using any imported text renderer class, you don't need to use something like that for a text have a few characters like "Time: ", but if you're using long texts, it's better use another text object for dynamic parts of text file even you're using anyother renderer or you're using flash's text input stuff.
I mean, "text's font size" may be important for rendering text elements because of pixel count.

Add text to Alternativa3d?

I'm creating an app with Alternativa3d (8.17.0), and would like to add labels to some cubes. But it doesn't seem like the Alternativa API provides a way to do it...
Now I know I can either:
Add a TextField to the Flash display list in the normal manner
Render the text as a bitmap beforehand and upload as a resource to the GPU
Render the text to a bitmap at run time, and upload as a resource to the GPU
BUT I need the content to be added directly to the Alternativa cube (which precludes the first option) and the text is dynamic (i.e. not known at compile time - precludes the second) and the third just feels hacky.
Is there a clean way to do this?
Depending on how you want the text displayed you could do a number of different things..
You could use a Sprite3D and add the text rendered as a bitmap. You can place the sprite3d near the cube and it will always face the camera so as you move around the cubes they will appear in 3d space but facing you at all times.
Another option is to add it to the actual cube as suggested by danii using a movieclip. However the link to that MovieClipMaterial is no longer valid and is actually for a previous version of Alternativa not version 8. I have created my own movieclipmaterial for version 8 here ( http://davidejones.com/blog/1392-moviematerial-alternativa3d-8/ ) should you want to do that.
Lastly you could render the text to bitmap and merge this with the cubes bitmap so the text is layered on top and then set this material onto the cube.
Personallt i'd use the sprite3d method its alot easier and i think will give a better effect. Take a look at this example which uses the same effect ( http://gkb40.ur.ru/web/map40a3d.swf )
Just put your TextField inside a MovieClip, and use the class MovieClipMaterial to set that MovieClip as a material for one of the sides of the cube.

Remove text within certain identifiers from html string in AS3

For a project, I'm trying import htmlText into flash, and then remove any items flash will not process. For example, the html I want to import contains custom "[caption][/caption]" code. I essentially want to remove these identifiers and any text from in between them so that flash will not display them in a text field. Does anyone have a good suggestion/example for me? I have been trying to figure out how to use regular expressions to do this, but have been unsuccessful in finding a good guide for it and so have failed.
And example of text I'm trying to filter:
<em>Pushmo</em> is a game filled with questions. How do I solve this puzzle? Is that a 8-bit Mario's face? Why is this old, obese blob making tons of death traps that easily ensnare and encase unsuspecting children?
[caption id="attachment_37414" align="alignleft" width="400" caption="The fat, red sumo goes into the most dangous place imaginable."]<img class="size-medium wp-image-37414" title="Pushmo-title" src="/2011/12/pushmo-3ds-title-screen-400x203.jpg" alt="Pushmo Title Screen" width="400" height="203" />[/caption]
<em>Pushmo</em> is a downloadable puzzle game in the 3DS eShop. In <em>Pushmo</em> you take on the role of Mallo, an amorphic red sumo wrestler with the mind of an Einstienian savant.
I'm looking to be able to detect identifying text and remove anything between them. I'd appreciate any suggestions anyone can give me.
You might be able to use indexOf and lastIndexOf to achieve this without regex.
Also you should have a look at String.replace
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/String.html
and an as3 regex tutorial:
http://snipplr.com/view/6608/as3-regular-expression-basics/
finally a tutorial for pure regex:
http://www.regular-expressions.info/tutorial.html