Skip to content

Commit

Permalink
Merge pull request #282 from SofiaEct/main
Browse files Browse the repository at this point in the history
agregar apuntes SofiaEct
  • Loading branch information
montoyamoraga authored Nov 19, 2024
2 parents c525678 + f1e77f6 commit d121b2a
Show file tree
Hide file tree
Showing 101 changed files with 82 additions and 0 deletions.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/12.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/13.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/14.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/15.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/16.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/17.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/18.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/19.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/20.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/21.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/22.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/23.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/24.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/25.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/26.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/27.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/28.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/29.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/30.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 05-SofiaEct/clase-14/BIEN-samples/31.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/32.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/33.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/34.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/35.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/36.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/37.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/38.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/39.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/4.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/40.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/41.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/42.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/43.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/44.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/45.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/46.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/47.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/48.jpg
Binary file added 05-SofiaEct/clase-14/BIEN-samples/49.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/0.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/1.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/10.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/11.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/12.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/13.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/14.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/15.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/16.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/17.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/18.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/19.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/2.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/20.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/21.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/22.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/23.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/24.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/25.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/26.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/27.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/28.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/29.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/3.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/30.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/31.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/32.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/33.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/34.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/35.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/36.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/37.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/38.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/39.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/4.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/40.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/41.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/42.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/43.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/44.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/45.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/46.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/47.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/48.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/49.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/5.jpg
Binary file added 05-SofiaEct/clase-14/MAL-samples/50.jpg
80 changes: 80 additions & 0 deletions 05-SofiaEct/clase-14/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,81 @@
# clase-14

´´´javascript
<div>Teachable Machine Pose Model</div>
<button type="button" onclick="init()">Start</button>
<div><canvas id="canvas"></canvas></div>
<div id="label-container"></div>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@teachablemachine/[email protected]/dist/teachablemachine-pose.min.js"></script>
<script type="text/javascript">
// More API functions here:
// https://github.com/googlecreativelab/teachablemachine-community/tree/master/libraries/pose

// the link to your model provided by Teachable Machine export panel
const URL = "./my_model/";
let model, webcam, ctx, labelContainer, maxPredictions;

async function init() {
const modelURL = URL + "model.json";
const metadataURL = URL + "metadata.json";

// load the model and metadata
// Refer to tmImage.loadFromFiles() in the API to support files from a file picker
// Note: the pose library adds a tmPose object to your window (window.tmPose)
model = await tmPose.load(modelURL, metadataURL);
maxPredictions = model.getTotalClasses();

// Convenience function to setup a webcam
const size = 200;
const flip = true; // whether to flip the webcam
webcam = new tmPose.Webcam(size, size, flip); // width, height, flip
await webcam.setup(); // request access to the webcam
await webcam.play();
window.requestAnimationFrame(loop);

// append/get elements to the DOM
const canvas = document.getElementById("canvas");
canvas.width = size; canvas.height = size;
ctx = canvas.getContext("2d");
labelContainer = document.getElementById("label-container");
for (let i = 0; i < maxPredictions; i++) { // and class labels
labelContainer.appendChild(document.createElement("div"));
}
}

async function loop(timestamp) {
webcam.update(); // update the webcam frame
await predict();
window.requestAnimationFrame(loop);
}

async function predict() {
// Prediction #1: run input through posenet
// estimatePose can take in an image, video or canvas html element
const { pose, posenetOutput } = await model.estimatePose(webcam.canvas);
// Prediction 2: run input through teachable machine classification model
const prediction = await model.predict(posenetOutput);

for (let i = 0; i < maxPredictions; i++) {
const classPrediction =
prediction[i].className + ": " + prediction[i].probability.toFixed(2);
labelContainer.childNodes[i].innerHTML = classPrediction;
}

// finally draw the poses
drawPose(pose);
}

function drawPose(pose) {
if (webcam.canvas) {
ctx.drawImage(webcam.canvas, 0, 0);
// draw the keypoints and skeleton
if (pose) {
const minPartConfidence = 0.5;
tmPose.drawKeypoints(pose.keypoints, minPartConfidence, ctx);
tmPose.drawSkeleton(pose.keypoints, minPartConfidence, ctx);
}
}
}
</script>
´´´
Binary file added 05-SofiaEct/clase-14/TALVEZ-samples/0.jpg
Binary file added 05-SofiaEct/clase-14/TALVEZ-samples/1.jpg
Binary file added 05-SofiaEct/clase-14/TALVEZ-samples/10.jpg
Binary file added 05-SofiaEct/clase-14/TALVEZ-samples/11.jpg
Binary file added 05-SofiaEct/clase-14/TALVEZ-samples/12.jpg
1 change: 1 addition & 0 deletions 05-SofiaEct/clase-14/my-pose-model/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"tfjsVersion":"1.3.1","tmVersion":"0.8.6","packageVersion":"0.8.6","packageName":"@teachablemachine/pose","timeStamp":"2024-11-19T14:09:48.669Z","userMetadata":{},"modelName":"my-pose-model","labels":["BIEN","MAL","MAS O MENOS","TALVEZ"],"modelSettings":{"posenet":{"architecture":"MobileNetV1","outputStride":16,"inputResolution":257,"multiplier":0.75}}}
1 change: 1 addition & 0 deletions 05-SofiaEct/clase-14/my-pose-model/model.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"modelTopology":{"class_name":"Sequential","config":{"name":"sequential_2","layers":[{"class_name":"Dense","config":{"units":100,"activation":"relu","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_in","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense1","trainable":true,"batch_input_shape":[null,14739],"dtype":"float32"}},{"class_name":"Dropout","config":{"rate":0.5,"noise_shape":null,"seed":null,"name":"dropout_Dropout1","trainable":true}},{"class_name":"Dense","config":{"units":4,"activation":"softmax","use_bias":false,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_in","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense2","trainable":true}}]},"keras_version":"tfjs-layers 1.3.1","backend":"tensor_flow.js"},"weightsManifest":[{"paths":["weights.bin"],"weights":[{"name":"dense_Dense1/kernel","shape":[14739,100],"dtype":"float32"},{"name":"dense_Dense1/bias","shape":[100],"dtype":"float32"},{"name":"dense_Dense2/kernel","shape":[100,4],"dtype":"float32"}]}]}
Binary file added 05-SofiaEct/clase-14/my-pose-model/weights.bin
Binary file not shown.

0 comments on commit d121b2a

Please sign in to comment.