Skip to main content

A Python client to interface with Presage Technologies' API services.

Project description

presage_technologies

The information contained in this Python client, API, or data responses as expected from normal usage of the data should not be used to diagnose, treat, or prevent any disease or illness whether directly or indirectly. This is for informational and research purposes only.

A Python client for Presage Technologies' APIs. Presage Technologies

License

Provided under [MIT License] by Presage Technologies.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

General

Currently, the only API used in this package is for Physiology API The functions and methods for this library should mirror the endpoints specified by the Physiology API documentation.

Installation

Installation for the package can be done via pip:

$ pip install presage_technologies

Physiology Usage

Google Colab Demo

Open In Colab

After installation, import the client class into your project and initialize with the API key:

from presage_technologies import Physiology
physio = Physiology("api_key_here")

Use .queue_processing_hr_rr() to upload your video for processing and return an id for the upload to allow for async processing. You are able to upload multiple videos as you would like as long as it is within your plan limits.

video_id = physio.queue_processing_hr_rr("/path/to/video/file")

We currently recommend waiting half the length of your video to start checking whether it is not but this is not a hard limit. When you are ready to start checking for the result you can use .retrieve_result() with your video_id to return the results.

video_id = physio.queue_processing_hr_rr("/path/to/video/file", preprocess=True)

Run Preprocessing steps locally to decrease processing and network transfer times. When you are ready to start checking for the result you can use .retrieve_result() with your video_id to return the results.

data = physio.retrieve_result(video_id)

Data will return a dictionary with keys hr and rr. Both will have keys that represent the time within the video the value was recorded.

data = physio.list_uploads()

Data will return a list of dictionaries with keys id and upload_date.

Limitations

In order to ensure best performance, we recommend that the videos you process meet the following conditions. Within a 20 second window, it is ideal if there is a single foremost subject in view. That subject's gaze is mostly unchanged and looking in the general direction of the acquiring camera. The subject’s face, shoulders and chest should be visible. Well-lit, uniformly-lit, and consistently-lit environments will also ensure optimal performance. Videos must be acquired at frame rates greater than 10 frames per second.

Video format

The current API requires that input videos have a standard, RGB color encoding. We ensure support for the following formats: AVI, MOV and MP4.

ISO/Exposure/Gain

Some cameras automatically adjust exposure time, gain, ISO or f/stop in order to optimize image brightness. This can be problematic for Presage Vitals if said values vary dramatically. While Presage can deal with varying lighting changes in the recording environment, rapid lighting changes can cause ISO, gain, and exposure to vary significantly and be problematic for proper vital extraction. For optimal results, ensure the recording device is not performing rapid ISO/exposure/gain adjustments or keep the scene illumination relative constant.

Distance

Presage technology can measure vitals for a large degree of subject to camera distance. It only requires that there are at least approximately 100 camera pixels across the face and that said face is in focus. For a 12 megapixel camera, this is approximately 3-5% of the total width of the image.

Extreme imaging distances in atmospheric conditions that display visible scintillation in recorded videos can cause errors in the vital extraction.

Lighting

While Presage can deal with monochromatic visible light sources for illumination, broadband light sources covering the entire visible spectrum are ideal.

Scene illumination should not be too dark or too bright. Ensure the average recorded pixel intensity of the subject's face is above 30% of the dynamic range of the recording device without gain being applied. Also, ensure the pixels corresponding to the subject's face are not saturated. Video recorded not following these lighting guidelines could result in no vitals being obtained.

Motion

Camera motion

Although we expect to handle camera motion in the future, currently large degrees of camera motion will severely impact the ability to generate respiration rate and may impact heart rate output. For optimal results, maintain a fairly still camera position during each 20 second window in which vital measurements are desired.

Subject motion

Similar to camera motion, we have found that subject motion can degrade the ability to reliably generate a respiratory rate measurement and to a lesser degree, a heart rate measurement. It takes approximately 10 seconds of video with a stationary subject before a new vital measurement is returned. If a subject moves their head significantly, that counter resets. We recommend the subject remains still, with their gaze pointed towards the acquiring camera. The subject should also refrain from talking as this leads to errors in respiration rate measurements.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Presage Technologies-1.3.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

Presage_Technologies-1.3.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file Presage Technologies-1.3.0.tar.gz.

File metadata

  • Download URL: Presage Technologies-1.3.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/5.0.0 keyring/23.9.3 rfc3986/2.0.0 colorama/0.4.6 CPython/3.7.10

File hashes

Hashes for Presage Technologies-1.3.0.tar.gz
Algorithm Hash digest
SHA256 cfb808360393e70a65c9b56183c677a05a1f8b86a311df3df569026bcf3560d4
MD5 ee5d9d5a8b3dd8900040a2e27066e511
BLAKE2b-256 022d815a8a3212b686f7577018ecb672aa2afc8bf5fedcea4a300b046291db4e

See more details on using hashes here.

File details

Details for the file Presage_Technologies-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: Presage_Technologies-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/5.0.0 keyring/23.9.3 rfc3986/2.0.0 colorama/0.4.6 CPython/3.7.10

File hashes

Hashes for Presage_Technologies-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f8ea2881e0535720342a8a7730e1a31b93df6303f584d6959ee3b4ff0c6bd83
MD5 87b70aff63d77f77986990943b406fbe
BLAKE2b-256 4cfce4b65c1bada0884a8caee0ee2a6ba234cc79a2237806b2aad79d57e947ac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page