Text

Answered

Multiple IINKEditor objects can be created with the one IINKEngine?

Dear Team,

The response from your team is highly appreciated. We are able to recognise our hand-written text by your SDK now.


Few queries are below:

- Shall we create multiple IINKEditor objects with the IINKEngine instance?  If yes, each editor can process the recognition of strokes simultaneously ?

- On creating object for IINKEditor, it requires a part & viewSize to be assigned. Shall we create N number of part(IINKContentPart)s in one package (IINKContentPackage)?

- Any performance issues if we create many editor objects & packages/parts with the same IINKEngine?

Example Usage:  Our document has hundreds of pages with handwritten text, and we wanted to process each page to get recognition text information. If we have limitation in creating editor objects, we need to process one after the other which may needs more time hence user may not get the expected results.


Can you please help us with the clarifications for above queries?


Thanks,

Steve


Best Answer

Dear Steve,


Currently,few weeks ago, my colleague Mael povided with an update on another post, in which you were facing huge memory consumption. Did you apply the recommendations he provided? https://developer-support.myscript.com/support/discussions/topics/16000024522


If so, did it reduce the memory consumption?


Rergarding your current question, we would like to do a profiling to ensure we do not have any memory leak:

-First, which language are you using?

-Is it possible to have an ink sample that is causing the high increase in memory consumption?

=>If the Mael's recommendations are applied, you should normally only have one recognition process running at a time! This should then allow us to profile the memory usage!


Thank you,


Best regards,


Olivier


Dear Steve,

thank you for your questions.

To answer these:

-Shall we create multiple IINKEditor objects with the IINKEngine instance?

>> You can indeed create multiple IINKEditor objects with one IINKEngine instance.


-If yes, each editor can process the recognition of strokes simultaneously?

>> Yes, multiple editors can run recognition in parallel, provided they are associated with different parts.


-On creating object for IINKEditor, it requires a part & viewSize to be assigned. Shall we create N number of part(IINKContentPart)s in one package (IINKContentPackage)?

>>It depends on your use-case:

- If you don’t need to save your package into a file, one part per package will provide the best performances

- If you want to save your package to file, one content package for all the parts may be more convenient if you want to avoid saving many files to disk.


-Any performance issues if we create many editor objects & packages/parts with the same IINKEngine?

>>-From a performance point of view, it is recommended to have one package and one part per editor.

-If you have more editors than CPU cores, the performance will be degraded.


-Our document has hundreds of pages with handwritten text, and we wanted to process each page to get recognition text information.

If we have limitation in creating editor objects, we need to process one after the other which may needs more time hence user may not get the expected results.

>>For you particular use-case, do you want to keep the content package or just do the recognition?

-Indeed, if you just want to do the recognition, we recommend you have one content part and one content package.


>> If our understanding is correct, you are trying to recognize text from already existing notes.If that’s the case, here are a few additional advices that may help you getting the best out of iink SDK:

1.    Provide all strokes at once via the editor pointerEvents API, with doProcessGestures:NO

This ensures best performances and stability and is meant to be used in such ink import use case.

2.    Deactivate text guidelines (before creating Text parts): [engine.configuration setBoolean:@"text.guides.enable" value:NO error:nil];

Existing notes have not been written with these guidelines, so recognition will be better without them.


Best regards,

Olivier



Dear Olivier,

Thanks a lot for your patience in clarifying our queries. It really helped us in improvising the results.


Thanks,

Steve

Dear Oliver,

Many of our users are complaining about crashes happening due to the high memory allocation (around 600-700 MB) while recognizing the written text in a page. Our users are having a page with around 10,000 strokes. When we process all those strokes in one shot by using below method, it's allocating huge memory which is causing to crash the app. Can you please guide us to fix this?

Our code sample:
===========================

    NSError *error;

    @try{

        [self.editor pointerEvents:pointerEvents count:events.count doProcessGestures:NO error:&error];

        [self.editor waitForIdle]; // This line is allocating huge memory

 }

    @catch(NSException *e){ 

 }

  free(pointerEvents);

===========================

let jsonString: String? = try self.editor?.export_(IINKContentBlock(), mimeType: IINKMimeType.JIIX)

Here we are getting the json result of recognition info.

===========================


Looking forward to hearing from you.


Thanks,

Steve

image

Answer

Dear Steve,


Currently,few weeks ago, my colleague Mael povided with an update on another post, in which you were facing huge memory consumption. Did you apply the recommendations he provided? https://developer-support.myscript.com/support/discussions/topics/16000024522


If so, did it reduce the memory consumption?


Rergarding your current question, we would like to do a profiling to ensure we do not have any memory leak:

-First, which language are you using?

-Is it possible to have an ink sample that is causing the high increase in memory consumption?

=>If the Mael's recommendations are applied, you should normally only have one recognition process running at a time! This should then allow us to profile the memory usage!


Thank you,


Best regards,


Olivier

  • Support
  • Forums
  • Text
  • Multiple IINKEditor objects can be created with the one IINKEngine?