Skip to content

Commit

Permalink
Merge pull request #217 from SainsburyWellcomeCentre/pose-logging
Browse files Browse the repository at this point in the history
Add logging of all pose identity scores
  • Loading branch information
glopesdev authored Jun 12, 2024
2 parents c5406a6 + 43e03a4 commit bc533fd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Aeon.Acquisition/Aeon.Acquisition.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Description>A package providing common acquisition and control functionality for all Project Aeon experiments.</Description>
<PackageTags>Bonsai Rx Project Aeon Acquisition</PackageTags>
<TargetFramework>net472</TargetFramework>
<VersionPrefix>0.5.1</VersionPrefix>
<VersionPrefix>0.6.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
</PropertyGroup>

Expand All @@ -24,7 +24,7 @@
<PackageReference Include="Harp.TimestampGeneratorGen3" Version="0.1.0" />
<PackageReference Include="Bonsai.Osc" Version="2.7.0" />
<PackageReference Include="Bonsai.Pylon" Version="0.3.0" />
<PackageReference Include="Bonsai.Sleap" Version="0.2.0" />
<PackageReference Include="Bonsai.Sleap" Version="0.3.0" />
<PackageReference Include="Bonsai.Spinnaker" Version="0.7.1" />
<PackageReference Include="Bonsai.System" Version="2.8.0" />
<PackageReference Include="Bonsai.Scripting.Expressions" Version="2.8.0" />
Expand Down
16 changes: 12 additions & 4 deletions src/Aeon.Acquisition/FormatPose.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ public IObservable<HarpMessage> Process(IObservable<Timestamped<PoseIdentity>> s
var i = 0;
var pose = payload.Value;
var timestamp = payload.Seconds;
var data = new float[5 + pose.Count * 3];
var data = new float[4 + pose.IdentityScores.Length + pose.Count * 3];
data[i++] = IdentityIndex.GetValueOrDefault(pose.IdentityIndex);
data[i++] = pose.Confidence;
for (int k = 0; k < pose.IdentityScores.Length; k++)
{
data[i++] = pose.IdentityScores[k];
}
data[i++] = pose.Centroid.Position.X;
data[i++] = pose.Centroid.Position.Y;
data[i++] = pose.Centroid.Confidence;
Expand All @@ -51,11 +55,15 @@ public IObservable<HarpMessage> Process(IObservable<Timestamped<PoseIdentityColl
return poseCollection.Select((pose, index) =>
{
int i = 0;
var data = new float[5 + pose.Count * 3];
var data = new float[4 + pose.IdentityScores.Length + pose.Count * 3];
data[i++] = IdentityIndex.HasValue
? IdentityIndex.GetValueOrDefault() + index
: pose.IdentityIndex;
data[i++] = pose.Confidence;
for (int k = 0; k < pose.IdentityScores.Length; k++)
{
data[i++] = pose.IdentityScores[k];
}
data[i++] = pose.Centroid.Position.X;
data[i++] = pose.Centroid.Position.Y;
data[i++] = pose.Centroid.Confidence;
Expand Down

0 comments on commit bc533fd

Please sign in to comment.