Public
Edited
Dec 1, 2022
Insert cell
function getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
Insert cell
img_blob = FileAttachment("claudio_y_vallejo.jpeg").blob();
Insert cell
img_url = getBase64(img_blob);
Insert cell
response = fetch('https://hysts-mediapipe-pose-estimation.hf.space/api/predict/', { method: "POST", body: JSON.stringify({"data":[ img_url, 1, true, 0.5, "white"

]}), headers: { "Content-Type": "application/json" } })
Insert cell
json_response = response.json()
Insert cell
json_response
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more