The issue arises when trying to convert t to a float in TensorFlow within an Angular environment because

I've been working on integrating TensorFlow Facemesh into my Angular application. After importing all the necessary modules and experimenting with different models, I am currently using:

import * as tf from '@tensorflow/tfjs';
import * as facemesh from '@tensorflow-models/facemesh';

The function causing issues is as follows:

const faceEstimate = await model.estimateFaces(video));
console.log(faceEstimate);

The exact error that I'm encountering is:

(in promise): TypeError: t.toFloat is not a function
TypeError: t.toFloat is not a function
    at facemesh.esm.js:17

I am using Angular 10 for this project. Any assistance would be greatly appreciated.

Update: I also attempted to use a Different Model with MediaPipe, but unfortunately encountered the same error.

Answer №1

Encountered a similar problem and resolved it by reverting back to version 2.6.0 of the following packages: "@tensorflow/tfjs-backend-webgl": "^2.6.0", "@tensorflow/tfjs-converter": "^2.6.0", "@tensorflow/tfjs-core": "^2.6.0",

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The art of combining Angular 6 with CSS styling for dynamic

Can we dynamically set a value in an scss file from the ts component like demonstrated below? public display: "none" | "block"; ngOnInit(): void { this.display = "none"; } ::ng-deep #clear { display: {{display}} !imp ...

What is the best way to allow a C# Web API method to be accessed from any origin?

My C# Web API includes the following method: public JsonResult PlanItems(string sessionId) { Response.Headers.Add("Access-Control-Allow-Origin", "*"); DTDBDataService svc = new DTDBDataService(_db); VM.PlanItems = svc.GetPla ...

What could be the reason for receiving 'undefined' in TypeScript after saving data in a variable?

When working on my program, I encountered an issue where I am trying to create a service and declare a variable within the service. I then created a get() method in the service to print the variable by calling the service method from a component, but I k ...

Experiencing Typescript errors solely when running on GitHub Actions

I've been working on a React+Vite project with the Dockerfile below. Everything runs smoothly when I execute it locally, but I encounter errors like Cannot find module '@/components/ui/Button' or its corresponding type declarations and error ...

How to calculate the total of a field in an Angular 4 model

How can I calculate the sum of fields N1 to N5 in the Trans model? public class Trans { public int id { get; set; } public int N1 { get; set; } public int N2 { get; set; } public int N3 { get; set; } public int N4 { get; set; } pub ...

Is it normal that aws-eventbridge-lambda does not generate a Lambda function?

I've been experimenting with the AWS CDK (Typescript) to enhance my knowledge. I'm interested in setting up a lambda function to run daily at a specific time or at intervals of N minutes. Since I anticipate having multiple functions, it would be ...

Hello everyone, can someone provide guidance on integrating Spring Boot session with an Angular project?

Can anyone provide guidance on utilizing a Spring Boot session in an Angular project? I am looking to send the login and password via POST request in the following image Click here for image description ...

Defining the return type with TypeScript using the keyof accessor: A comprehensive guide

Can a function be created that utilizes keyof to access an object's property, with TypeScript inferring the return value? interface Example { name: string; handles: number; } function get(n: keyof Example) { const x: Example = {name: &apo ...

Exploring the world of external libraries with NPM in Angular 2 using TypeScript

I am currently utilizing Ionic2 (Browserify) and Typescript with NPM. I have been exploring how typescript compiles the code into bundles and what gets included in the bundle. I noticed that some of my node require files are referenced automatically, whil ...

Ionic3 footer using ion-tabs

Is there a way to create a common footer for all pages with 5 buttons, where the first button is selected by default? The page opened by this first button should have three tabs. I have already created the tabs but am unsure how to add the footer without r ...

The binding element 'string' is automatically assigned an 'any' type

Here is the code I am working with: function Child( { name: string } ) { return ( <div> {name ? ( <h3> The <code>name</code> in the query string is &quot;{name} &quot; </h3& ...

The necessity of segregating Angular packages and the rationale behind their importance

Recently, I embarked on the journey of building a brand new Angular 2 app. After conducting thorough research by reading articles and downloading free apps from GitHub, I noticed that all of them included the angular/common package along with other package ...

The specified 'Promise<Modules>' type argument cannot be assigned to the parameter of type '(params: any) => Promise<Modules>' in the current context

Looking for some help with this helper function that I need to call, it has the following signature: export const fetchPaginated = async <T>( callback: (params: any) => Promise<T>, { page = 1, pageSize, }: { page?: number; page ...

Angular2 Application refreshing upon triggering an event

As a newcomer to Angular2 and SPA development, please forgive me if this question seems silly. I am currently following a tutorial where multiple components are being used. When clicking on an element, an event is supposed to be emitted and subsequently c ...

Struggling to import SVG files in Gatsby's TypeScript project? Error message: "Element type is invalid: expected a string"?

Struggling to incorporate SVG files into my Gatsby TypeScript project, I've implemented the gatsby-plugin-react-svg plugin. The app is prompting an error message that reads: One unhandled runtime error found in your files. See the list below to fix it ...

Show the address of the image stored in the database

I am looking for a way to display related images using ngFor Here is an example: <div class="row" *ngFor="let name of cheaterNames"> <div class="col-4"> {{ name.name }} <img src="{{name.path}}" class="rounded mx-auto d-block ...

I am unable to access the 'push' property in Angular/Typescript because it is undefined

I am encountering an issue while attempting to add an array of Funcionarios objects into a Equipa object. When trying to use the push method to add a new Funcionarios object, I receive the error message TypeError: Cannot read property 'push' of u ...

What is the best way to manage static asset files in Vite?

I have an SVG file located in the "public/img/" directory. However, when I try to import this image file using import imgUrl from './img/googlenews.svg';, it doesn't seem to work. The file path where I wrote the import rule is (not sure if ...

Encountering an issue with the 'createObjectURL' function in URL, resulting in overload resolution failure when using npm file-saver

While working on my angular app, I encountered a situation where I needed to download user details uploaded as a Word document to my local machine using the angular app. Successfully, I was able to upload and save this data to my database, getting its byte ...

Accessing the Parent Variable from a Function in JavaScript: A Guide

How can you properly retrieve the value of x? let x = 5 const f = (n:number) => { let x = "Welcome"; return x * n // Referring to the first x, not the second one } Also, what is the accurate technical term for this action? ...