Comments (5)
Unfortunately, yes, the latest changes we have made to support multi-track annotations have led to a break in back-compatibility. One solution might be to use the old version to export the annotations to some other readable format that contains all the pertinent information (start and end times of annotations, values for each attribute, etc), and then have an app using the new psi version to read the exported file and generate a stream of TimeIntervalAnnotationSet
objects that capture the annotations. If your annotations are single-track (they must be since you generated them with the old version), each new TimeIntervalAnnotationSet
object will end up containing a single TimeIntervalAnnotation
. You'll also need to generate a new annotation schema file (I think in old nomenclature this was the annotation definition file). If you are able to share the old schema, we can help explain what the new corresponding one might need to look like.
from psi.
Thank you for your assistance. This is the old schema file:
LevelsOfNeedAnnotationDefinition.TXT
from psi.
So the sketch of the solution to migrate the annotations would look like this:
Step 1. Write a \psi application (using the old version of psi) that reads the annotation stream and writes it (perhaps via some Do
operator) to a text file in an easily readable format.
Step 2. Create a new annotation schema file. Based on the schema you have sent above, I think the new annotation schema file should probably look something like this:
{
"Name": "LevelsOfNeedAnnotationDefinition",
"AttributeSchemas": [{
"Name": "LevelsOfNeedAnnotation",
"ValueSchema": {
"$type": "Microsoft.Psi.Data.Annotations.EnumerableAnnotationValueSchema`1[[System.String, mscorlib]], Microsoft.Psi.Data",
"DefaultValue": "0",
"PossibleValues": [
{
"Value": "0"
},
{
"Value": "1",
"FillColor": "Red",
"TextColor": "White",
},
{
"Value": "2",
"FillColor": "Green",
"TextColor": "White",
},
{
"Value": "3",
"FillColor": "Blue",
"TextColor": "White",
},
{
"Value": "Flow",
"FillColor": "Yellow",
"TextColor": "Blue",
},
]
}
}
]
}
Save this file under a name like LevelsOfNeed.schema.json
Step 3. Write a new \psi application (using the new version of psi) that reads all the information about your annotations from the text file you wrote at step 1, and creates a new stream with messages of type TimeIntervalAnnotationSet
that will contain the new annotations. To do so, you will need to first load the new schema like so:
var annotationSchema = AnnotationSchema.LoadFrom(path + "LevelsOfNeed.schema.json");
To create a stream of TimeIntervalAnnotationSet
objects corresponding to the annotations, you can either use some generator, like Generators.Sequence
followed by a Select
operator to create the corresponding TimeIntervalAnnotationSet
, or you can try to leverage some of the existing ToTimeIntervalAnnotations(...)
stream operators that exist in Microsoft.Psi.Data\Annotations\Operators.cs.
Either way, once you have the stream, you need to write it to a psi store, like this:
annotationsStream.Write(annotationSchema, $"Objects", outputStore);
Note that this is a bit different than the regular operator for writing psi streams to a store, in that the first parameter will be the annotationSchema object, then followed by the stream name and the output store.
Hope this helps, but if you go down this path and get stuck/have concrete questions, please continue posting to the issue.
from psi.
We used a generator and wrote the stream to a new store. We can visualize the new annotation stream in PsiStudio and it appears to align with the audio stream. However, we are having difficulty reading from the store in a new \psi application. When comparing the metadata of the annotations generated from the CSV file and new annotations we created in PsiStudio using the same schema, it appears that the creation times are different. Could the creation time be a possible source of the problem and if so how can we change the creation time?
from psi.
To better understand the problem, could you provide a bit more details regarding:
-
what the values are for the creation and originating times of the messages on the streams, and the differences observed between them
-
how exactly you ran the pipeline (which parameters were passed to Pipeline.Run) and how the generator was written for writing the stream to the store
-
when you say you are having difficulty reading from the store in a new \psi application, in what way is that manifesting? Are you trying to read this stream together with other streams?
from psi.
Related Issues (20)
- How to write asynchronous components to a store HOT 7
- Feature request: Option to record audio with MixedReality UWP's PhotoVideoCamera class HOT 2
- Feature request: Pause a pipeline HOT 11
- FFmpeg probelm HOT 2
- Question about "FFMPEGMediaSource.cs" HOT 2
- Request to make Microsoft.Psi.MixedReality.StereoKitTransforms properties public HOT 3
- Troubles with RemoteImporter HOT 6
- Will the implementation of "Continual Learning about Objects in the Wild: An Interactive Approach" be opensource? HOT 2
- PSI on Oculus Quest (Android) HOT 4
- Publicizing StereoKitTransforms properties HOT 1
- `NullReferenceException` in MixedReality.cs HOT 1
- Thread-safety bug for the pipeline's stopping state HOT 1
- HoloLens 2 ir cam intrinsics HOT 4
- Fix missing project Microsoft.Psi.Audio.Windows in solution HoloLensCapture.sln
- \psi Studio's 3D panel not rendering properly when using the integrated GPU (but ok with an external monitor) HOT 1
- [Bug]: Hitting an exception when attempting to start hololenscaptureapp in hololens2 using VS2022 HOT 5
- Memory usage of SharedImagePool keeps growing HOT 3
- Poor Serialization Performance for the Diagnostics's `TrackMessageSize` HOT 4
- [Question] Subpipline stop without stopping parent pipline HOT 5
- .NET Native Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psi.