Description
Uniovi Simur WearablePerMed Predictor.
Build and publish docker image
You must install docker previous to use these commands
To build the image execute this command:
$ docker build -t wearablepermed-predictor:1.18.0 .
To tag the image to be published in simuruo docker hub account execute this command:
$ docker build tag wearablepermed-predictor:1.18.0 simuruo/wearablepermed-predictor:1.18.0
Login in simuruo docker hub account execute this command:
$ docker login -u simuruo
Password:
To publish image in simuruo docker hub account execute this command:
$ docker push simuruo/wearablepermed-predictor:1.18.0
Execute from Python package
If you want use our models published in Huggin Face you must execute a command like this:
$ predictor \
--model-type randomforest \
--sensor-channel accelerometer_gyroscope \
--segment-body wrist \
--class-type classes_4 \
--resources-folder /home/miguel/temp/models/wearablepermed_models/input \
--resource-id PMP1024_W1_M.csv \
--cases-folder /home/miguel/temp/models/wearablepermed_models/results \
--case-id case_M_BRF_acc_gyr_4_classes \
--case-file-format csv \
--verbose
If you want to use your custom models must execute a command like this:
$ predictor \
--model_file /home/miguel/git/uniovi/simur/uniovi-simur-wearablepermed-predictor/models/RandomForest.pkl,
--label_file /home/miguel/git/uniovi/simur/uniovi-simur-wearablepermed-predictor/models/label_encoder.pkl,
--resources-folder /home/miguel/temp/models/wearablepermed_models/input,
--resource-id PMP1024_W1_M.csv,
--cases-folder /home/miguel/temp/models/wearablepermed_models/results,
--case-id case_M_BRF_acc_gyr_4_classes,
--case-file-format csv,
--verbose
Actually only Ranfom Forest is implemented in predictor
Execute from docker image
$ docker run \
--rm \
-u $(id -u):$(id -g) \
-v /home/miguel/git/uniovi/simur/uniovi-simur-wearablepermed-predictor/data/input:/home/miguel/git/uniovi/simur/uniovi-simur-wearablepermed-predictor/data/input \
-v /home/miguel/git/uniovi/simur/uniovi-simur-wearablepermed-predictor/data/output:/home/miguel/git/uniovi/simur/uniovi-simur-wearablepermed-predictor/data/output \
simuruo/wearablepermed-predictor:1.18.0 \
--model-type randomforest \
--sensor-channel accelerometer_gyroscope \
--segment-body wrist \
--class-type classes_4 \
--resources-folder /home/miguel/git/uniovi/simur/uniovi-simur-wearablepermed-predictor/data/input \
--resource-id case_PI_BRF_acc_gyr_01/PMP1024_W1_PI_1.csv \
--cases-folder /home/miguel/git/uniovi/simur/uniovi-simur-wearablepermed-predictor/data/output \
--case-id case_PI_BRF_acc_gyr_4_classes_01 \
--verbose
Predictor arguments
These arguments are used if you select Python Package or Docker containers to execute predictor command:
-
model-type: The model type: esann, capture24, randomforest, xgboost.
-
sensor-channe: The model channels trained: accelerometer, accelerometer_gyroscope.
-
class-type: The model class type trained: classes_4, classes_15.
-
segment-body (*): The model segment body trained: thigh, wrist, hip.
-
model-file: if you want use your custom model set the model file
-
label-file: if you want use your custom labels set the label file
-
resources-folder (*): The root resourcers folder.
-
resource-id (*): The resource file id in csv format.
-
cases-folder: The root cases folder.
-
case-id: Case unique name where save results under cases-folder.
-
case-file-format: Case file format. Default is npz. Possible values: [npz, csv].
-
is-label-export: Specify if predictions are export as label format. Default is False.
-
is-database-export: The prediction result is database saved. Default is False.
-
verbose: activate verbose logging mode.
(*) are mandatory arguments
If you want login inside the container execute this command.
$ docker run \
--rm \
-it \
-u $(id -u):$(id -g) \
-v /home/miguel/git/uniovi/simur/uniovi-simur-wearablepermed-predictor/data/input:/home/miguel/git/uniovi/simur/uniovi-simur-wearablepermed-predictor/data/input \
-v /home/miguel/git/uniovi/simur/uniovi-simur-wearablepermed-predictor/data/output:/home/miguel/git/uniovi/simur/uniovi-simur-wearablepermed-predictor/data/output \
--entrypoint sh \
simuruo/wearablepermed-predictor:1.18.0
Default Value
All models offered by predictor are trained with
- Window size of 250 and overlapping of 50%.
- Right now only individual models are offered by predc¡ictor: Wrist, Thigh or Hip segment bodies.
Build and Publish in Pypi and Docker Hub
-
Set the final version to the precitor python package from file
setup.cfgversion = 1.18.0
-
Set the new version in the shell scripts:
run_predictor.sh,run_predictor.batLinux/Mac
run_predictor.shscript:# --- CONFIGURATION (Change these) --- PREDICTOR_VERSION="1.18.0"
Windows `run_predictor.bat script:
:: --- SYSTEM CONFIGURATION --- set PREDICTOR_VERSION=1.18.0
-
Rebuild and publish package in Pypi repository (You must have credentials)
$ tox -e clean $ tox -e build $ tox -e publish -- --repository pypi
-
Finally build docker image with the last version selected and publish in
simuruoDocker Hub account (You must have credentials)$ docker build -t wearablepermed-predictor:1.18.0 . $ docker tag wearablepermed-predictor:1.18.0 simuruo/wearablepermed-predictor:1.18.0 $ docker push simuruo/wearablepermed-predictor:1.18.0
Note
This project has been set up using PyScaffold 4.6. For details and usage information on PyScaffold see https://pyscaffold.org/.
Metadata
Release files for uniovi-simur-wearablepermed-predictor 1.25.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| uniovi_simur_wearablepermed_predictor-1.25.0.tar.gz | 32.7 kB | Without provenance | Details for uniovi_simur_wearablepermed_predictor-1.25.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| uniovi_simur_wearablepermed_predictor-1.25.0-py3-none-any.whl | Python 3 | none | any | Details for uniovi_simur_wearablepermed_predictor-1.25.0-py3-none-any.whl |
Total release size: 48.1 kB
Release files / uniovi_simur_wearablepermed_predictor-1.25.0.tar.gz
| Download URL | uniovi_simur_wearablepermed_predictor-1.25.0.tar.gz |
|---|---|
| Size | 32.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a0a431ef892b69bd05ffd53bb27dd7d0d3406cc0ee95659448624680ccc36ec2
|
|
BLAKE2b-256 checksum How to use checksums |
8df238679f3429f5331a27b0f3431772ccf5cdc72784379097dcfcee4907f759
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / uniovi_simur_wearablepermed_predictor-1.25.0-py3-none-any.whl
| Download URL | uniovi_simur_wearablepermed_predictor-1.25.0-py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7703a673a0bac11c0e191a3625cfbb9e072f612220754e87f0cf21f3c3bcc123
|
|
BLAKE2b-256 checksum How to use checksums |
2db74e0faaf89be379e9d7a1308067cb8e925a5b80d1148b19f606019413dd84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for uniovi-simur-wearablepermed-predictor 1.25.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.