fixed inference bugs

add DONE during inference, correct handling on C# side
This commit is contained in:
Alex Bezdieniezhnykh
2025-02-01 02:09:11 +02:00
parent e7afa96a0b
commit 739759628a
23 changed files with 324 additions and 95 deletions
+2 -7
View File
@@ -31,16 +31,11 @@ public class PythonInferenceService(ILogger<PythonInferenceService> logger, IOpt
while (true)
{
byte[] bytes = [];
try
{
var annotationStream = dealer.Get<AnnotationImage>(out bytes);
var annotationStream = dealer.Get<AnnotationImage>(bytes => bytes.Length == 4 && Encoding.UTF8.GetString(bytes) == "DONE");
if (annotationStream == null)
{
if (bytes.Length == 4 && Encoding.UTF8.GetString(bytes) == "DONE")
break;
continue;
}
break;
await processAnnotation(annotationStream);
}