pref: reduce GC events
This commit is contained in:
parent
0fc3773812
commit
35a8a96898
1 changed files with 3 additions and 2 deletions
|
@ -15,9 +15,10 @@ class OnnxImageEncoder {
|
|||
..setIntraOpNumThreads(1)
|
||||
..setSessionGraphOptimizationLevel(GraphOptimizationLevel.ortEnableAll);
|
||||
try {
|
||||
final bytes = await File(args["imageModelPath"]).readAsBytes();
|
||||
final session = OrtSession.fromBuffer(bytes, sessionOptions);
|
||||
final session =
|
||||
OrtSession.fromFile(File(args["imageModelPath"]), sessionOptions);
|
||||
_logger.info('image model loaded');
|
||||
|
||||
return session.address;
|
||||
} catch (e, s) {
|
||||
_logger.severe(e, s);
|
||||
|
|
Loading…
Add table
Reference in a new issue