diff --git a/external/BodybuildingPoseClassifier/.gitignore b/external/BodybuildingPoseClassifier/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..fa3ee952d98a6ba5ad4f5ce596dc40ceb7edf1c5 Binary files /dev/null and b/external/BodybuildingPoseClassifier/.gitignore differ diff --git a/external/BodybuildingPoseClassifier/LICENSE b/external/BodybuildingPoseClassifier/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..f65de1b470e055e0652b487716001a21b281b7c8 --- /dev/null +++ b/external/BodybuildingPoseClassifier/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 David Unterguggenberger + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +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. diff --git a/external/BodybuildingPoseClassifier/README.md b/external/BodybuildingPoseClassifier/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3eda641c9e7db6d02d9dbe20e9ab051e834dcc85 --- /dev/null +++ b/external/BodybuildingPoseClassifier/README.md @@ -0,0 +1,36 @@ +# Bodybuilding Pose Classifier + +## Project Overview +This model is trained to identify and classify various bodybuilding poses from images. The aim of this project is to demonstrate the application of deep learning techniques for automated image recognition in specific sports disciplines. + +## Model Description +The model uses a Convolutional Neural Network (CNN) architecture to recognize specific poses from images of bodybuilders. It has been trained with training data and validated with validation data to ensure the accuracy and robustness of the model. + +## Datasets +- **Training Data**: Consists of 25 images per pose category, captured from different angles and under various lighting conditions. +- **Validation Data**: Used to monitor the model's performance during training and to prevent overfitting. Contains 25 images per pose category, similar but not identical to the training images. + +## Technical Details +The model was developed in Python using the following libraries and technologies: + +- **TensorFlow and Keras**: For constructing, training, and validating the CNN. +- **NumPy**: For data manipulation and processing. +- **Matplotlib**: For visualizing training and validation results. +- **ImageDataGenerator from Keras**: Used for image preprocessing and data augmentation to enhance model performance by increasing the diversity of the training data. + +## Installation +1. Clone the repository: + ```bash + git clone https://github.com/JumpiiX/BodybuildingPoseClassifier.git + ``` +2. Install the required dependencies: + ```bash + pip install -r requirements.txt + ``` + +## Usage + +### Train and Test the Model +To train and test the model, execute the following command: +```bash +python training/train_model.py diff --git a/external/BodybuildingPoseClassifier/app.py b/external/BodybuildingPoseClassifier/app.py new file mode 100644 index 0000000000000000000000000000000000000000..535c7c678864da2196dea1ead30dffea11e3f6d4 --- /dev/null +++ b/external/BodybuildingPoseClassifier/app.py @@ -0,0 +1,39 @@ +from flask import Flask, request, render_template +from tensorflow.keras.models import load_model +from tensorflow.keras.preprocessing import image +import numpy as np +import os + +app = Flask(__name__) + +model_path = 'bodybuilding_pose_classifier.h5' + +model = load_model(model_path) + +class_labels = ['Side Chest', 'Front Double Biceps', 'Back Double Biceps', 'Front Lat Spread', 'Back Lat Spread'] + +def predict_pose(img_path): + img = image.load_img(img_path, target_size=(150, 150)) + img_array = image.img_to_array(img) + img_array = np.expand_dims(img_array, axis=0) / 255.0 + predictions = model.predict(img_array) + predicted_class = np.argmax(predictions, axis=1) + return class_labels[predicted_class[0]] + +@app.route('/', methods=['GET', 'POST']) +def upload_file(): + if request.method == 'POST': + if 'file' not in request.files: + return 'No file part' + file = request.files['file'] + if file.filename == '': + return 'No selected file' + if file: + filepath = os.path.join('uploads', file.filename) + file.save(filepath) + pose = predict_pose(filepath) + return render_template('result.html', pose=pose) + return render_template('index.html') + +if __name__ == '__main__': + app.run(debug=True) diff --git a/external/BodybuildingPoseClassifier/bodybuilding_pose_classifier.h5 b/external/BodybuildingPoseClassifier/bodybuilding_pose_classifier.h5 new file mode 100644 index 0000000000000000000000000000000000000000..9d240c29f3e41feab777dd0a1a1f5149e672bfba --- /dev/null +++ b/external/BodybuildingPoseClassifier/bodybuilding_pose_classifier.h5 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56cdfbdadbef2675622e699fcf444d5bcb0aab6c695bb32165ae60e984278346 +size 228483160 diff --git a/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/1.png b/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/1.png new file mode 100644 index 0000000000000000000000000000000000000000..f050be4d390b3954aa5b03bd3d7a81c61b635dcf --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5440053672ec87fc41e0cb84a06e65530b07089b97e14fd6c03353626199d701 +size 135066 diff --git a/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/2.png b/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/2.png new file mode 100644 index 0000000000000000000000000000000000000000..0b2560350b08e86328c504bd327955cf58f1cbbc --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15e9746d1be1ddea281ef00397544ac9c24c4916da457ed031f3d7a887d7c911 +size 265891 diff --git a/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/3.png b/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/3.png new file mode 100644 index 0000000000000000000000000000000000000000..a44b52c590f8b7f3bcad3712c65a8ec2ed384811 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4f7fad1724559c7e8c9e5f194319c53cda8cd4e348637e3dd6eb23613043f08 +size 77099 diff --git a/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/4.png b/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/4.png new file mode 100644 index 0000000000000000000000000000000000000000..24cd8e8821249db13a02d5742e0c890984872ee0 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e07f1fad25d945058f7ad0aca59aa8b94e09944c854b0e9e34044c59eb0c797 +size 208804 diff --git a/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/5.png b/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/5.png new file mode 100644 index 0000000000000000000000000000000000000000..2d33ae1bdb5112527ca13b743dd601096bc95cc9 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/bDoubleBiceps/5.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c2b2af04e222173466077f643b52586554a40bd7c76b25e819f512dfe11b2a6 +size 71337 diff --git a/external/BodybuildingPoseClassifier/data/train/bLatSpread/1.png b/external/BodybuildingPoseClassifier/data/train/bLatSpread/1.png new file mode 100644 index 0000000000000000000000000000000000000000..dbf5508477d5cfb005f56a07fdd47ffbb22ae388 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/bLatSpread/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9cd241f12be1a8cd8d973ea961117b3df1002955c5442ee1ab6b021f9bf685e9 +size 135066 diff --git a/external/BodybuildingPoseClassifier/data/train/bLatSpread/2.png b/external/BodybuildingPoseClassifier/data/train/bLatSpread/2.png new file mode 100644 index 0000000000000000000000000000000000000000..1dd24ee004902fca30316b983b046025f7756f19 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/bLatSpread/2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef940b257992544d565ee12c46e52728b63894ebaa0da78d30e57fcdde3c3530 +size 266043 diff --git a/external/BodybuildingPoseClassifier/data/train/bLatSpread/3.png b/external/BodybuildingPoseClassifier/data/train/bLatSpread/3.png new file mode 100644 index 0000000000000000000000000000000000000000..8b50c2265050a912bc5fa4676ee3440727169b23 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/bLatSpread/3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1420ef2f25068da9cad993ea98ac5f8bde60a60d30a1f957354f2637f7485900 +size 77099 diff --git a/external/BodybuildingPoseClassifier/data/train/bLatSpread/4.png b/external/BodybuildingPoseClassifier/data/train/bLatSpread/4.png new file mode 100644 index 0000000000000000000000000000000000000000..e361611efbdd6e1584e14a029acd9ae3223afb5b --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/bLatSpread/4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64f651e474091f2371645a609f02234c3130f3a2872840ab9c479e41624173c1 +size 208804 diff --git a/external/BodybuildingPoseClassifier/data/train/bLatSpread/5.png b/external/BodybuildingPoseClassifier/data/train/bLatSpread/5.png new file mode 100644 index 0000000000000000000000000000000000000000..acc494258c9d77136788f1a8ed34f1bac3279671 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/bLatSpread/5.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50c8a7094345d559e0b323d2457aa945baed89070d7bc37a233e5cb2d807b503 +size 71337 diff --git a/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/1.png b/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/1.png new file mode 100644 index 0000000000000000000000000000000000000000..d7ccd8e34896edbd6d8e6190e1d85ce7ec9a783c --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8fbd7328135e1613dc1b42da5d284947e7c468fa5dcf8d64132323e74750e983 +size 174398 diff --git a/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/2.png b/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/2.png new file mode 100644 index 0000000000000000000000000000000000000000..2e016a85ee4c2027966a132c3df26357c1e7f109 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f52b1b72ba7cb81111f0e607261fa6b351ea99302ba9b39b02758929a39b9eea +size 83704 diff --git a/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/3.png b/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/3.png new file mode 100644 index 0000000000000000000000000000000000000000..0f60c09710cdd7e388a6a4e7df2ea9d1c7bca394 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c342dc95a7baefa6ae21ba70538fa46855adb5cf4bd44f46f17ab354fc17d9f5 +size 776527 diff --git a/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/4.png b/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/4.png new file mode 100644 index 0000000000000000000000000000000000000000..d84949b0153874016c465c59ba7aca68a3eeed15 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f047bb89fad39b7dccb037d9087d3ad297836c5b057b0dceaba26b7de21e2d8 +size 140393 diff --git a/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/5.png b/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/5.png new file mode 100644 index 0000000000000000000000000000000000000000..5403cb64c475617cf4fca171481d4dbedf685b3b --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/fDoubleBiceps/5.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f6312e1a23d81d91e3641bfd48cc65a091bd6d862d5273031c03502dc8265dc +size 27127 diff --git a/external/BodybuildingPoseClassifier/data/train/fLatSpread/1.png b/external/BodybuildingPoseClassifier/data/train/fLatSpread/1.png new file mode 100644 index 0000000000000000000000000000000000000000..e9e7148ef547728ef3f5fc2e95b139eb56588550 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/fLatSpread/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5682d7432c53bece76d7cf356c5c00b24e04caa275bdaf0aad54fa6ed0dcb05 +size 300660 diff --git a/external/BodybuildingPoseClassifier/data/train/fLatSpread/2.png b/external/BodybuildingPoseClassifier/data/train/fLatSpread/2.png new file mode 100644 index 0000000000000000000000000000000000000000..3d8c2e8cd6dd0050dd3a3f4088de9d07edc949a9 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/fLatSpread/2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d62196cc38e5c53f3bf979a4f1fd0f17f913b43e5024fc9bd83023de6b58b7f +size 170131 diff --git a/external/BodybuildingPoseClassifier/data/train/fLatSpread/3.png b/external/BodybuildingPoseClassifier/data/train/fLatSpread/3.png new file mode 100644 index 0000000000000000000000000000000000000000..b844a7ec45e977b14e62d5d69701fa5f160a4a8e --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/fLatSpread/3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac4b33cd16d813659a70f86b513904a5b7110a97c21b9b7da36b169c81a86ccb +size 170706 diff --git a/external/BodybuildingPoseClassifier/data/train/fLatSpread/4.png b/external/BodybuildingPoseClassifier/data/train/fLatSpread/4.png new file mode 100644 index 0000000000000000000000000000000000000000..b53d481757fdc9a0c69de5360659ea39d4915293 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/fLatSpread/4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5021d8f1f71856cc4f884bdcb3745249902768d6abc3d1001400f0424440bdb0 +size 301816 diff --git a/external/BodybuildingPoseClassifier/data/train/fLatSpread/5.png b/external/BodybuildingPoseClassifier/data/train/fLatSpread/5.png new file mode 100644 index 0000000000000000000000000000000000000000..a625c0a65856dfa44470f69579f2285d792e7151 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/fLatSpread/5.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51fb2ebaac0f94b103ed46691dc2342e7b1404bbb1ea2b7ad8f1598c0747022c +size 26069 diff --git a/external/BodybuildingPoseClassifier/data/train/sideChest/1.png b/external/BodybuildingPoseClassifier/data/train/sideChest/1.png new file mode 100644 index 0000000000000000000000000000000000000000..f0f4ce1e463b8967eceba1ab4270ed1e7d17e6c6 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/sideChest/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3387cccd855266dbb09c94e868d59c237362029d898e4d1747e3e1f861901058 +size 1141257 diff --git a/external/BodybuildingPoseClassifier/data/train/sideChest/2.png b/external/BodybuildingPoseClassifier/data/train/sideChest/2.png new file mode 100644 index 0000000000000000000000000000000000000000..389d964ed3ec1d07f813383d2a71ee2ac92fc829 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/sideChest/2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13dd967d300dfeed38e9e9d2a9f996c3eb60b1b3b1469a9e03a79d4ffc0d0872 +size 217418 diff --git a/external/BodybuildingPoseClassifier/data/train/sideChest/3.png b/external/BodybuildingPoseClassifier/data/train/sideChest/3.png new file mode 100644 index 0000000000000000000000000000000000000000..95910fba70188706f1ace839e5bd3655b59981ee --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/sideChest/3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d30c205f65c8f573726c92179ce9bd10f0b68039239e83e06e17f9c41f73dd66 +size 416234 diff --git a/external/BodybuildingPoseClassifier/data/train/sideChest/4.png b/external/BodybuildingPoseClassifier/data/train/sideChest/4.png new file mode 100644 index 0000000000000000000000000000000000000000..7542cf6168eb5ad2684662804a531f7fa102c845 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/sideChest/4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66b766735050834d2cca9ea8f88f1e99cc82e6ad34a4d74c6390883f24aed96d +size 35361 diff --git a/external/BodybuildingPoseClassifier/data/train/sideChest/5.png b/external/BodybuildingPoseClassifier/data/train/sideChest/5.png new file mode 100644 index 0000000000000000000000000000000000000000..31ab4aa1c7766a03f2a6cf6d95965b69d4bc96ba --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/train/sideChest/5.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c4800143f35e6a26ba72ea60f02817aff262f0499c9c135e7e68f25e6dd6f00 +size 891662 diff --git a/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/1.png b/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/1.png new file mode 100644 index 0000000000000000000000000000000000000000..f050be4d390b3954aa5b03bd3d7a81c61b635dcf --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5440053672ec87fc41e0cb84a06e65530b07089b97e14fd6c03353626199d701 +size 135066 diff --git a/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/2.png b/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/2.png new file mode 100644 index 0000000000000000000000000000000000000000..0b2560350b08e86328c504bd327955cf58f1cbbc --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15e9746d1be1ddea281ef00397544ac9c24c4916da457ed031f3d7a887d7c911 +size 265891 diff --git a/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/3.png b/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/3.png new file mode 100644 index 0000000000000000000000000000000000000000..a44b52c590f8b7f3bcad3712c65a8ec2ed384811 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4f7fad1724559c7e8c9e5f194319c53cda8cd4e348637e3dd6eb23613043f08 +size 77099 diff --git a/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/4.png b/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/4.png new file mode 100644 index 0000000000000000000000000000000000000000..24cd8e8821249db13a02d5742e0c890984872ee0 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e07f1fad25d945058f7ad0aca59aa8b94e09944c854b0e9e34044c59eb0c797 +size 208804 diff --git a/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/5.png b/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/5.png new file mode 100644 index 0000000000000000000000000000000000000000..2d33ae1bdb5112527ca13b743dd601096bc95cc9 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/bDoubleBiceps/5.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c2b2af04e222173466077f643b52586554a40bd7c76b25e819f512dfe11b2a6 +size 71337 diff --git a/external/BodybuildingPoseClassifier/data/validation/bLatSpread/1.png b/external/BodybuildingPoseClassifier/data/validation/bLatSpread/1.png new file mode 100644 index 0000000000000000000000000000000000000000..dbf5508477d5cfb005f56a07fdd47ffbb22ae388 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/bLatSpread/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9cd241f12be1a8cd8d973ea961117b3df1002955c5442ee1ab6b021f9bf685e9 +size 135066 diff --git a/external/BodybuildingPoseClassifier/data/validation/bLatSpread/2.png b/external/BodybuildingPoseClassifier/data/validation/bLatSpread/2.png new file mode 100644 index 0000000000000000000000000000000000000000..1dd24ee004902fca30316b983b046025f7756f19 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/bLatSpread/2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef940b257992544d565ee12c46e52728b63894ebaa0da78d30e57fcdde3c3530 +size 266043 diff --git a/external/BodybuildingPoseClassifier/data/validation/bLatSpread/3.png b/external/BodybuildingPoseClassifier/data/validation/bLatSpread/3.png new file mode 100644 index 0000000000000000000000000000000000000000..8b50c2265050a912bc5fa4676ee3440727169b23 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/bLatSpread/3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1420ef2f25068da9cad993ea98ac5f8bde60a60d30a1f957354f2637f7485900 +size 77099 diff --git a/external/BodybuildingPoseClassifier/data/validation/bLatSpread/4.png b/external/BodybuildingPoseClassifier/data/validation/bLatSpread/4.png new file mode 100644 index 0000000000000000000000000000000000000000..e361611efbdd6e1584e14a029acd9ae3223afb5b --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/bLatSpread/4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64f651e474091f2371645a609f02234c3130f3a2872840ab9c479e41624173c1 +size 208804 diff --git a/external/BodybuildingPoseClassifier/data/validation/bLatSpread/5.png b/external/BodybuildingPoseClassifier/data/validation/bLatSpread/5.png new file mode 100644 index 0000000000000000000000000000000000000000..acc494258c9d77136788f1a8ed34f1bac3279671 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/bLatSpread/5.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50c8a7094345d559e0b323d2457aa945baed89070d7bc37a233e5cb2d807b503 +size 71337 diff --git a/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/1.png b/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/1.png new file mode 100644 index 0000000000000000000000000000000000000000..d7ccd8e34896edbd6d8e6190e1d85ce7ec9a783c --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8fbd7328135e1613dc1b42da5d284947e7c468fa5dcf8d64132323e74750e983 +size 174398 diff --git a/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/2.png b/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/2.png new file mode 100644 index 0000000000000000000000000000000000000000..2e016a85ee4c2027966a132c3df26357c1e7f109 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f52b1b72ba7cb81111f0e607261fa6b351ea99302ba9b39b02758929a39b9eea +size 83704 diff --git a/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/3.png b/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/3.png new file mode 100644 index 0000000000000000000000000000000000000000..0f60c09710cdd7e388a6a4e7df2ea9d1c7bca394 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c342dc95a7baefa6ae21ba70538fa46855adb5cf4bd44f46f17ab354fc17d9f5 +size 776527 diff --git a/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/4.png b/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/4.png new file mode 100644 index 0000000000000000000000000000000000000000..d84949b0153874016c465c59ba7aca68a3eeed15 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f047bb89fad39b7dccb037d9087d3ad297836c5b057b0dceaba26b7de21e2d8 +size 140393 diff --git a/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/5.png b/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/5.png new file mode 100644 index 0000000000000000000000000000000000000000..5403cb64c475617cf4fca171481d4dbedf685b3b --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/fDoubleBiceps/5.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f6312e1a23d81d91e3641bfd48cc65a091bd6d862d5273031c03502dc8265dc +size 27127 diff --git a/external/BodybuildingPoseClassifier/data/validation/fLatSpread/1.png b/external/BodybuildingPoseClassifier/data/validation/fLatSpread/1.png new file mode 100644 index 0000000000000000000000000000000000000000..e9e7148ef547728ef3f5fc2e95b139eb56588550 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/fLatSpread/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5682d7432c53bece76d7cf356c5c00b24e04caa275bdaf0aad54fa6ed0dcb05 +size 300660 diff --git a/external/BodybuildingPoseClassifier/data/validation/fLatSpread/2.png b/external/BodybuildingPoseClassifier/data/validation/fLatSpread/2.png new file mode 100644 index 0000000000000000000000000000000000000000..3d8c2e8cd6dd0050dd3a3f4088de9d07edc949a9 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/fLatSpread/2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d62196cc38e5c53f3bf979a4f1fd0f17f913b43e5024fc9bd83023de6b58b7f +size 170131 diff --git a/external/BodybuildingPoseClassifier/data/validation/fLatSpread/3.png b/external/BodybuildingPoseClassifier/data/validation/fLatSpread/3.png new file mode 100644 index 0000000000000000000000000000000000000000..b844a7ec45e977b14e62d5d69701fa5f160a4a8e --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/fLatSpread/3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac4b33cd16d813659a70f86b513904a5b7110a97c21b9b7da36b169c81a86ccb +size 170706 diff --git a/external/BodybuildingPoseClassifier/data/validation/fLatSpread/4.png b/external/BodybuildingPoseClassifier/data/validation/fLatSpread/4.png new file mode 100644 index 0000000000000000000000000000000000000000..b53d481757fdc9a0c69de5360659ea39d4915293 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/fLatSpread/4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5021d8f1f71856cc4f884bdcb3745249902768d6abc3d1001400f0424440bdb0 +size 301816 diff --git a/external/BodybuildingPoseClassifier/data/validation/fLatSpread/5.png b/external/BodybuildingPoseClassifier/data/validation/fLatSpread/5.png new file mode 100644 index 0000000000000000000000000000000000000000..a625c0a65856dfa44470f69579f2285d792e7151 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/fLatSpread/5.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51fb2ebaac0f94b103ed46691dc2342e7b1404bbb1ea2b7ad8f1598c0747022c +size 26069 diff --git a/external/BodybuildingPoseClassifier/data/validation/sideChest/1.png b/external/BodybuildingPoseClassifier/data/validation/sideChest/1.png new file mode 100644 index 0000000000000000000000000000000000000000..f0f4ce1e463b8967eceba1ab4270ed1e7d17e6c6 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/sideChest/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3387cccd855266dbb09c94e868d59c237362029d898e4d1747e3e1f861901058 +size 1141257 diff --git a/external/BodybuildingPoseClassifier/data/validation/sideChest/2.png b/external/BodybuildingPoseClassifier/data/validation/sideChest/2.png new file mode 100644 index 0000000000000000000000000000000000000000..389d964ed3ec1d07f813383d2a71ee2ac92fc829 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/sideChest/2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13dd967d300dfeed38e9e9d2a9f996c3eb60b1b3b1469a9e03a79d4ffc0d0872 +size 217418 diff --git a/external/BodybuildingPoseClassifier/data/validation/sideChest/3.png b/external/BodybuildingPoseClassifier/data/validation/sideChest/3.png new file mode 100644 index 0000000000000000000000000000000000000000..95910fba70188706f1ace839e5bd3655b59981ee --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/sideChest/3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d30c205f65c8f573726c92179ce9bd10f0b68039239e83e06e17f9c41f73dd66 +size 416234 diff --git a/external/BodybuildingPoseClassifier/data/validation/sideChest/4.png b/external/BodybuildingPoseClassifier/data/validation/sideChest/4.png new file mode 100644 index 0000000000000000000000000000000000000000..7542cf6168eb5ad2684662804a531f7fa102c845 --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/sideChest/4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66b766735050834d2cca9ea8f88f1e99cc82e6ad34a4d74c6390883f24aed96d +size 35361 diff --git a/external/BodybuildingPoseClassifier/data/validation/sideChest/5.png b/external/BodybuildingPoseClassifier/data/validation/sideChest/5.png new file mode 100644 index 0000000000000000000000000000000000000000..31ab4aa1c7766a03f2a6cf6d95965b69d4bc96ba --- /dev/null +++ b/external/BodybuildingPoseClassifier/data/validation/sideChest/5.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c4800143f35e6a26ba72ea60f02817aff262f0499c9c135e7e68f25e6dd6f00 +size 891662 diff --git a/external/BodybuildingPoseClassifier/main.py b/external/BodybuildingPoseClassifier/main.py new file mode 100644 index 0000000000000000000000000000000000000000..dfc93bec76115c9062559c95fc2730d50b7744da --- /dev/null +++ b/external/BodybuildingPoseClassifier/main.py @@ -0,0 +1,44 @@ +import os +from tensorflow.keras.preprocessing.image import ImageDataGenerator +from models.model import build_model + +train_dir = os.path.join('data', 'train') +validation_dir = os.path.join('data', 'validation') + +train_datagen = ImageDataGenerator( + rescale=1./255, + rotation_range=40, + width_shift_range=0.2, + height_shift_range=0.2, + shear_range=0.2, + zoom_range=0.2, + horizontal_flip=True +) + +validation_datagen = ImageDataGenerator(rescale=1./255) + +train_generator = train_datagen.flow_from_directory( + train_dir, + target_size=(150, 150), + batch_size=20, + class_mode='categorical' +) + +validation_generator = validation_datagen.flow_from_directory( + validation_dir, + target_size=(150, 150), + batch_size=20, + class_mode='categorical' +) + +model = build_model() + +history = model.fit( + train_generator, + steps_per_epoch=100, + epochs=30, + validation_data=validation_generator, + validation_steps=50 +) + +model.save('bodybuilding_pose_classifier.h5') diff --git a/external/BodybuildingPoseClassifier/models/__pycache__/model.cpython-310.pyc b/external/BodybuildingPoseClassifier/models/__pycache__/model.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5157836b1273ad2f5891cd0cbc4e6b2745af5af4 Binary files /dev/null and b/external/BodybuildingPoseClassifier/models/__pycache__/model.cpython-310.pyc differ diff --git a/external/BodybuildingPoseClassifier/models/model.py b/external/BodybuildingPoseClassifier/models/model.py new file mode 100644 index 0000000000000000000000000000000000000000..75b0897f299db42ab9d0e4ae06df99c822596b97 --- /dev/null +++ b/external/BodybuildingPoseClassifier/models/model.py @@ -0,0 +1,22 @@ +from tensorflow.keras.models import Sequential +from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense, Dropout + +def build_model(): + model = Sequential([ + Conv2D(32, (3, 3), activation='relu', input_shape=(150, 150, 3)), + MaxPooling2D(2, 2), + Conv2D(64, (3, 3), activation='relu'), + MaxPooling2D(2, 2), + Conv2D(128, (3, 3), activation='relu'), + MaxPooling2D(2, 2), + Flatten(), + Dense(512, activation='relu'), + Dropout(0.5), + Dense(5, activation='softmax') + ]) + + model.compile(loss='categorical_crossentropy', + optimizer='adam', + metrics=['accuracy']) + + return model diff --git a/external/BodybuildingPoseClassifier/requirements.txt b/external/BodybuildingPoseClassifier/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..7097f64791fcdaf250c417c538bbd4e5f55d3e74 --- /dev/null +++ b/external/BodybuildingPoseClassifier/requirements.txt @@ -0,0 +1,7 @@ +Flask +tensorflow +keras +numpy +matplotlib +pillow +scipy \ No newline at end of file diff --git a/external/BodybuildingPoseClassifier/templates/index.html b/external/BodybuildingPoseClassifier/templates/index.html new file mode 100644 index 0000000000000000000000000000000000000000..a310d1e8f36e634277decbb1e55932f2028edd9a --- /dev/null +++ b/external/BodybuildingPoseClassifier/templates/index.html @@ -0,0 +1,57 @@ + + +
+ + +Upload an image to find out which bodybuilding pose it is.
+ +