Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Commit e17e737

Browse files
committed
Bugfix found during regression
1 parent 8993731 commit e17e737

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

OnnxStack.Core/Config/OnnxModelPrecision.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
public enum OnnxModelPrecision
44
{
5-
F32 = 0,
6-
F16 = 1
5+
F16 = 0,
6+
F32 = 1
77
}
88
}

OnnxStack.Core/Video/VideoInfo.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ private float GetFramesPerSecond()
8484
if (FrameCount == 0 || DurationSeconds == 0)
8585
return 0;
8686

87-
return FrameCount / DurationSeconds;
87+
var framesPerSec = FrameCount / DurationSeconds;
88+
if (framesPerSec < 1)
89+
return MathF.Round(framesPerSec, 2);
90+
91+
return MathF.Round(framesPerSec, 0);
8892
}
8993
}
9094
}

OnnxStack.FeatureExtractor/Pipelines/FeatureExtractorPipeline.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,11 @@ public async Task<OnnxVideo> RunAsync(OnnxVideo video, Action<OnnxImage, OnnxIma
102102
var featureFrames = new List<OnnxImage>();
103103
foreach (var videoFrame in video.Frames)
104104
{
105-
var result = await RunAsync(videoFrame, cancellationToken);
105+
var result = await ExtractImageAsync(videoFrame, cancellationToken);
106106
featureFrames.Add(result);
107107
progressCallback?.Invoke(videoFrame, result);
108108
}
109+
109110
_logger?.LogEnd("Extracting OnnxVideo features complete.", timestamp);
110111
return new OnnxVideo(video.Info, featureFrames);
111112
}

0 commit comments

Comments
 (0)