Should this boxes for my custom Object Detector be smaller? - tensorflow

So Im trying to make a Object Detector for this companys forms, and we have labelled the images as shown in the example image I uploaded, my question is: Should We make more accurate boxes or is OK as they are, since the written part that we are trying to detect could be bigger.
So, what im asking is: In the example image, the "Descripcion" part or Description, has just 2 lines of text, but it could be more, should we make the box to just select the Description title + the 2 lines or so we stick to what we are doing now title + the 2 lines + all blank space that could have been filled with lines

It depends on what you really want to do with the detected boxes. What are the next steps, can the next step e.g. extracting the text handle all the free space, or would it be better to just the the part where it is actually written.
Besides that right now in your example I find that most boxes are too big. The form is more or less already splitted in boxes and it could be better to make the boxes smaller and more accurate e.g.the box around IMPORTE and some amount in €. I would label this closer. So the box only contains the information you actually want and nothing else.
But as I said it really depends on the next step the boxes should be used for.

Related

Add text box at specific location in report base on value

I'm working on a cut list generator but I'm having difficulty on the final report. I'd like to display a rectangle that represents the factory length piece with lines indicating cut points. In each segment I'd like to have the length of the piece shown. Using Report.line I've created the rectangles needed but I'm not sure how to get text in each box. Here is a sample output so far As an example I want the three rectangles for Piece #1 to have 48" in them, probably all the way to the left. Any suggestions? I thought createReportControl might work but I'm not sure that is the correct approach. I'm also thinking about one text box with a monospace font so I can scale the input across the entire width. Any suggestions are appreciated.
Thanks,
Dave
I played around with the monospace font idea. It isn't as pretty as I would like but I'm getting closer.
The issue is that I cannot keep the text in the same spot in each box. There is one line lower on the page that pushes the number almost out the right side of the box.
Sample Output
This code is functional but I'm looking at the cosmetics. I'm inserting spaces between my values using the following function:
Private Function InsertSpaces(CutLen, PieceLen) As String
MaxChar = 50 ' 6 inch 14pt Courier text box
cutchar = Int(CutLen / PieceLen * MaxChar)
Cutcharcount = Len(Str(CutLen))
cutchar = cutchar - Cutcharcount + 1
For i = 1 To cutchar
InsertSpaces = InsertSpaces + " "
Next
End Function
I'm just trying to clean it up. CreateReportControl was giving me a error because I wasn't in design mode. I'm guessing that is because it ran as part of OnFormat of the Detail section.

How to make long text fit into a text_frame? Python-pptx

I'm working with python-ppt to create a portfolio of candidates in a Powerpoint presentation. There is one candidate per slide and each of them has provided information about themselves like name, contacts and a minibio (the problem I'm here to solve)
The text_frame, created with values of height and width, must fit the slide but must a contain all lenght of minibios, which is not happening.
In a long phase (>200 char, with font size 12) it exceeds the size of the text box and get "out" of the slide, so, in presentation mode or a PDF file, the "overrun" of text is lost
Is there any way to confine the text to the shape/size of the text_frame? (extra help if the solution wont change font size)
Just found one parameter that helped to find the answer
When creating a text_box object with slides.shapes.add_textbox() and adding a text_frame to it, the text_frame.word_wrap = True limits the text to be contained inside the dimentions of the text_box
The code shows it better
# creates text box with add_textbox(left, top, width, height)
txBox = slide.shapes.add_textbox(Cm(16),Cm(5),Cm(17),Cm(13))
tf = txBox.text_frame
tf.word_wrap = True
Before word_wrap parameter
After word_wrap parameter
The short answer is "No". PowerPoint is a page-layout environment, and much like the front page of a newspaper, text "story" content needs to be trimmed to fit the allotted space.
We're perhaps not used to this because word-processing, spreadsheet, and web-page content is "flowed" into a (practically) unlimited space, but the area of a PowerPoint slide is quite finite. Also, using it for large text blocks is somewhat of an off-label use. There is a certain amount of flexibility provided by reducing the font size, but not as much as one might expect. Even accommodating 20% additional text requires what appears as a pretty radical change in font size.
I've encountered this problem again and again, and the only solution I have ever seen work reliably is hand-curating the content to fit.
python-pptx has one experimental feature to address this but its operation has never been very satisfactory and it's tricky to get working. https://python-pptx.readthedocs.io/en/latest/api/text.html#pptx.text.text.TextFrame.fit_text
The business of fitting text is the role of a rendering engine, which python-pptx is not.

How to create 2D visualization from Access data set

I have a data set containing the following fields:
rack, rack_type, box_number, box_label, row, column
Each rack in the real world is basically a 2D grid with cells, each cell containing an object(a small box in this case). Each box will be associated with a specific position in the rack based on row and column. The size of the grid (number of rows/columns) is different based on rack_type
Is there a way to create a visual representation of these racks from the data supplied above? Specifically, I am looking to create a grid (as if you were looking at it in real life) where each cell shows some text--box_number and box_label in this case. I've been searching for hours on Google to no avail and I don't know if I'm even asking the question correctly. From what I can tell, the normal report/form features in Access do not support such a configuration of data. I'm wondering if there is some VBA solution, since I have some experience with VBA in Excel. Please let me know if this is incomprehensible gibberish.
If your racks has a finite maximum number of boxes in any configuration then you might consider this solution:
Let's say that any of your racks contains at most R boxes
create a form F
open F and add to it R text boxes B (they are not linked to anything)
save the form
now in VBA, on loading a rack you can iterate on each box and use some code to position each each of them on the form, show or hide it, and finally set its size!
Basically you've added to your form more boxes than a typical rack configuration would normally need, and by doing so you can hide some of them when not needed. You have this limit because you cannot create and add at runtime new text boxes to a form in VBA (it should work for reports too).
Note that you could use also other types of objects, text boxes are useful if you want to edit the text inside of them, otherwise you could use a label or anything that suits your needs the most (combo box... for example).
Basic methods that you might want to look at:
cell1.Height = 100
cell1.Visible = Not cell1.Visible
cell1.Move Left:=0, Top:=0, Width:=400, Height:=3000
Anyhow if you get more in details, by giving some examples of your racks we might be able to come with a more detailed solution.

Can I use the Shrink Method for the whole document in word

I don't know anything about code. I work with e-learnings in Storyline 3. I sometimes localize these e-learnings and use the translation tool in Articulate which basically exports an MS Word file. Sometimes the target languages are longer and I need to decrease the font size by percentage for the whole document. Usually, there are at least 3 different font sizes that I need to decrease accordingly. I am wan to develop a macro that I will use for multiple documents.
I couldn't find a way to do this by percentage, but looks like the Shrink or Grow Methods will do the work! I found this code in the reference page but looks like it works only for a selected object. The issue is that the exported MS Word file is in a table with each text box in the storyline separated to a cell. When I select the whole table it does not work.
If Selection.Type = wdSelectionNormal Then
Selection.Font.Grow
Else
MsgBox "You need to select some text."
End If
Could you please help me and let me know if this would be possible for the whole document, or the selected table? It would be very much appreciated. Thanks in advance.
It is unclear from your question whether the table in the Word document contains the actual text boxes or just the text they contain.
If it is just the text then Shrink may work. I tested this on a document with a single table containing only text:
ActiveDocument.Range.Font.Shrink

Eliminate stray whitespace between textboxes on a report

I have 4 stacked textboxes in the body of an SSRS report and am getting a stray space / extra line between textboxes 3 & 4.
This is for an address block - name / title / email / website. Can't put it in a single textbox with intervening vbcrlf tokens because the email and website are links. I've tried formatting it to remove vertical spacing; also calculated the exact position by taking top + height to calculate the position. And of course I've tried positioning it so there are exactly 0 pixels between the text boxes. If I reverse the position of #3 & #4 the rendering looks the same so it isn't stray formatting characters in the data fields.
The solution is to wrap the stacked boxes in a rectangle.
I had this problem as well. It blew my mind until I started over on another part of the form. The new boxes worked perfectly until I moved them to the right of another set of text boxes which had some word wrap in them. I realized the wordwrapped boxes were directly related to the gaps I was seeing the set of textboxes to the right. I guess there's some kind of poor markup going on that tries to line things up horizontally and enclosing the set of textboxes in a rectangle protects them from it.
good idea on putting the info into a table - jumping off that idea - I'm going to construct a dynamic string in my query and output the dynamic string into a textbox. thank you for the idea, I don't know why I didn't think to do that.
Simpler thing is to just check text alignment - the default is "default" which appears to be centered. Changing the text box to the right to "left" fixed this problem for me.
Reduce padding property of the textbox.
Once dragging the textbox one closer to the other the tooltip shows convergence points between two textboxes - make tooltip show 0 points
it is best I could do to control the spacing