Closed Yang-LONG closed 6 years ago
Hi!
The predicted annotations are stored in the batch component, specified in the annot
argument of the hmm_predict_pipeline
function. It is hmm_annotation
in your case:
ECG_MASK = "../cardio/tests/data/A*.hea" # specify a path to your signals here
MODEL_PATH = "./hmm_model.dill" # specify a path to your model here
eds = EcgDataset(path=ECG_MASK, no_ext=True, sort=True)
pipeline = eds >> hmm_predict_pipeline(MODEL_PATH, annot="hmm_annotation")
batch = pipeline.next_batch()
batch.show_ecg("A00001", start=0, end=5, annot="hmm_annotation")
print(batch.hmm_annotation)
These printed annotations match the lengths of the corresponding input signals and contain predicted HMM states. Additionally, the pipeline calculates median lengths of PQ, QT and QRS intervals along with their borders and the heart rate value based on these annotations and stores them in the meta
component:
META_KEYS = ["hr", "pq", "qt", "qrs", "qrs_segments", "p_segments", "t_segments"]
signal_meta = batch["A00001"].meta
print({key: signal_meta[key] for key in META_KEYS})
Yeah, it's solved! Thank you soooo much!:)
Hello, I wonder how I can get the annotation prediction of the segmentation from the following code?
The image can show them but I can't get them.
result:
I've tried from the 'show_ecg' source code:
but I got strange result:
Please help, thanks a lot!