Lädt...


🔧 HTML


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

I Have made a project using HTML and teachable machine in which I Had trained the AI Model to understand few book names by showing book's cover to it and the html will give the summary of the corresponding Book. The code is :
<!DOCTYPE html>




Teachable Machine Book Summary
<br> body { font-family: Arial, sans-serif; }<br> #summary-container { margin-top: 20px; }<br>


Teachable Machine Image Model


<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@teachablemachine/image@latest/dist/teachablemachine-image.min.js"></script>
<script type="text/javascript">
    const URL = "./my_model/"; // Ensure model files are correctly placed here
    let model, webcam;

    // Start as soon as the page loads
    window.onload = async function() {
        try {
            console.log("Attempting to load model...");
            const modelURL = URL + "model.json";
            const metadataURL = URL + "metadata.json";

            // Load the model
            model = await tmImage.load(modelURL, metadataURL);
            console.log("Model loaded!");

            // Set up the webcam
            const flip = true; // Flip the webcam
            webcam = new tmImage.Webcam(200, 200, flip); // Create the webcam instance
            await webcam.setup(); // Request permission to access the webcam
            console.log("Webcam setup complete!");

            await webcam.play(); // Start the webcam stream
            document.getElementById("webcam-container").appendChild(webcam.canvas); // Add webcam to page

            // Begin the loop to run predictions
            window.requestAnimationFrame(loop);
        } catch (error) {
            console.error("Error during initialization:", error);
        }
    };

    // Loop to continuously predict
    async function loop() {
        try {
            webcam.update(); // Update the webcam frame
            await predict();  // Make predictions
            window.requestAnimationFrame(loop); // Keep the loop going
        } catch (error) {
            console.error("Error during loop:", error);
        }
    }

    // Simple prediction function to check if the model works
    async function predict() {
        try {
            const prediction = await model.predict(webcam.canvas);
            console.log(prediction); // Log the predictions for debugging
        } catch (error) {
            console.error("Error during prediction:", error);
        }
    }
</script>

When I run this i am only getting "Teachable Machine Image Model" in the body.
I am a beginner and What should I do?

...

🔧 HTML Graphics, HTML Canvas, HTML SVG in detail with examples


📈 12.55 Punkte
🔧 Programmierung

🔧 HTML layout elements and techniques, HTML responsive web designs, HTML computer code elements


📈 12.55 Punkte
🔧 Programmierung

🔧 How to create navigation menu with HTML CSS step by step | web design tutorial | HTML CSS tutorial


📈 8.37 Punkte
🔧 Programmierung

📰 W3C Set To Publish HTML 5.1, Work Already Started On HTML 5.2


📈 8.37 Punkte
📰 IT Security

🔧 2/10 HTML | 30 Days of HTML CSS JS


📈 8.37 Punkte
🔧 Programmierung

🕵️ Circontrol CirCarLife up to 4.2 PLC Status /html/devstat.html weak authentication


📈 8.37 Punkte
🕵️ Sicherheitslücken

🔧 Validate HTML Code Quickly with HTML Validator Tool


📈 8.37 Punkte
🔧 Programmierung

📰 W3C Set to Publish HTML 5.1, Work Already Started on HTML 5.2


📈 8.37 Punkte
📰 IT Security

🐧 HTML: Überschriften formatieren mit HTML-Heading-Tags


📈 8.37 Punkte
🐧 Server

🕵️ CVE-2020-11454 | MicroStrategy Web 10.4 HTML Container Stored HTML injection (ID 157068)


📈 8.37 Punkte
🕵️ Sicherheitslücken

🕵️ cPanel up to 74 HTML Rendering index.html filename cross site scripting


📈 8.37 Punkte
🕵️ Sicherheitslücken

🕵️ http://natco.gov.pk/emails/html.html


📈 8.37 Punkte
🕵️ Hacking

🐧 HTML body: Das HTML-Element für darstellbare Inhalte


📈 8.37 Punkte
🐧 Server

🕵️ CirCarLife Scada 4.2.4 Upgrade html/upgrade.html Request privilege escalation


📈 8.37 Punkte
🕵️ Sicherheitslücken

🕵️ CVE-2024-10101 | binary-husky gpt_academic up to 3.83 HTML File HTML injection


📈 8.37 Punkte
🕵️ Sicherheitslücken

🕵️ CVE-2022-25887 | sanitize-html up to 2.7.0 HTML Comment incorrect regex


📈 8.37 Punkte
🕵️ Sicherheitslücken

🔧 Elevate Your HTML Skills with the 'HTML Practice Challenges' Course


📈 8.37 Punkte
🔧 Programmierung

🕵️ HTML and Javascript Teacher - Code examples in HTML and Javascript.


📈 8.37 Punkte
🕵️ Hacking

🕵️ CVE-2022-25303 | whoogle-search up to 0.7.1 HTML Template error.html q cross site scripting


📈 8.37 Punkte
🕵️ Sicherheitslücken

🕵️ CVE-2002-2424 | Ekilat PHP Reactor 1.2.7pl1 HTML Tag HTML injection (XFDB-9958 / BID-5569)


📈 8.37 Punkte
🕵️ Sicherheitslücken

🔧 HTML for Beginners – HTML Basics With Code Examples


📈 8.37 Punkte
🔧 Programmierung

🕵️ Jaspersoft JasperReports 4.7 HTML Source Code flow.html information disclosure


📈 8.37 Punkte
🕵️ Sicherheitslücken

🕵️ CVE-2021-40897 | split-html-to-chars 1.0.5 HTML incorrect regex


📈 8.37 Punkte
🕵️ Sicherheitslücken

🕵️ CVE-2024-38354 | hackmdio codimd up to 2.5.3 HTML Tag name HTML injection (GHSA-22jv-vch8-2vp9)


📈 8.37 Punkte
🕵️ Sicherheitslücken

🕵️ CVE-2024-23819 | GeoServer MapML HTML Page HTML injection


📈 8.37 Punkte
🕵️ Sicherheitslücken

🕵️ WP HTML Mail < 2.9.1 - HTML Injection


📈 8.37 Punkte
🕵️ Sicherheitslücken

🕵️ CVE-2023-39318 | Google Go html-template HTML injection (Nessus ID 208702)


📈 8.37 Punkte
🕵️ Sicherheitslücken

matomo