ক্লাউড রান জবস কিভাবে ব্যবহার করবেন & ভিডিও প্রক্রিয়া করার জন্য ভিডিও ইন্টেলিজেন্স API

১. ভূমিকা

সংক্ষিপ্ত বিবরণ

এই কোডল্যাবে, আপনি Node.js-এ লেখা একটি ক্লাউড রান জব তৈরি করবেন যা একটি ভিডিওর প্রতিটি দৃশ্যের ভিজ্যুয়াল বর্ণনা প্রদান করে। প্রথমে, আপনার জবটি ভিডিও ইন্টেলিজেন্স এপিআই (Video Intelligence API) ব্যবহার করে যখনই কোনো দৃশ্য পরিবর্তন হয়, তার টাইমস্ট্যাম্প শনাক্ত করবে। এরপর, আপনার জবটি ffmpeg নামক একটি থার্ড-পার্টি বাইনারি ব্যবহার করে প্রতিটি দৃশ্য-পরিবর্তনের টাইমস্ট্যাম্পের জন্য একটি স্ক্রিনশট ক্যাপচার করবে। সবশেষে, স্ক্রিনশটগুলোর ভিজ্যুয়াল বর্ণনা দেওয়ার জন্য ভার্টেক্স এআই ভিজ্যুয়াল ক্যাপশনিং (Vertex AI visual captioning) ব্যবহার করা হয়।

এই কোডল্যাবটি আরও দেখায় যে, কীভাবে আপনার ক্লাউড রান জবের মধ্যে ffmpeg ব্যবহার করে একটি নির্দিষ্ট টাইমস্ট্যাম্পে ভিডিও থেকে ছবি ক্যাপচার করা যায়। যেহেতু ffmpeg আলাদাভাবে ইনস্টল করতে হয়, তাই এই কোডল্যাবটি আপনাকে দেখায় কীভাবে আপনার ক্লাউড রান জবের অংশ হিসেবে ffmpeg ইনস্টল করার জন্য একটি ডকারফাইল তৈরি করতে হয়।

ক্লাউড রান জব কীভাবে কাজ করে তার একটি চিত্র এখানে দেওয়া হলো:

ক্লাউড রান জব ভিডিও বর্ণনার চিত্র

আপনি যা শিখবেন

  • ডকারফাইল ব্যবহার করে কীভাবে একটি থার্ড-পার্টি বাইনারি ইনস্টল করার জন্য কন্টেইনার ইমেজ তৈরি করতে হয়
  • ক্লাউড রান জবের জন্য একটি সার্ভিস অ্যাকাউন্ট তৈরি করে কীভাবে ন্যূনতম বিশেষাধিকারের নীতি অনুসরণ করে অন্যান্য গুগল ক্লাউড পরিষেবাগুলোকে কল করা যায়
  • ক্লাউড রান জব থেকে ভিডিও ইন্টেলিজেন্স ক্লায়েন্ট লাইব্রেরি কীভাবে ব্যবহার করবেন
  • Vertex AI থেকে প্রতিটি দৃশ্যের ভিজ্যুয়াল বিবরণ পেতে Google API-তে কীভাবে কল করতে হয়

২. সেটআপ এবং প্রয়োজনীয়তা

পূর্বশর্ত

ক্লাউড শেল সক্রিয় করুন

  1. ক্লাউড কনসোল থেকে, অ্যাক্টিভেট ক্লাউড শেল-এ ক্লিক করুন। d1264ca30785e435.png .

cb81e7c8e34bc8d.png

আপনি যদি প্রথমবারের মতো ক্লাউড শেল চালু করেন, তাহলে এটি কী তা বর্ণনা করে একটি মধ্যবর্তী স্ক্রিন আপনার সামনে আসবে। যদি একটি মধ্যবর্তী স্ক্রিন আসে, তাহলে 'চালিয়ে যান' (Continue) এ ক্লিক করুন।

d95252b003979716.png

ক্লাউড শেল প্রস্তুত করতে এবং এর সাথে সংযোগ স্থাপন করতে মাত্র কয়েক মুহূর্ত সময় লাগা উচিত।

7833d5e1c5d18f54.png

এই ভার্চুয়াল মেশিনটিতে প্রয়োজনীয় সমস্ত ডেভেলপমেন্ট টুলস লোড করা আছে। এটি একটি স্থায়ী ৫ জিবি হোম ডিরেক্টরি প্রদান করে এবং গুগল ক্লাউডে চলে, যা নেটওয়ার্ক পারফরম্যান্স ও অথেনটিকেশনকে ব্যাপকভাবে উন্নত করে। এই কোডল্যাবে আপনার প্রায় সমস্ত কাজই একটি ব্রাউজার দিয়ে করা সম্ভব।

ক্লাউড শেলে সংযুক্ত হওয়ার পর, আপনি দেখতে পাবেন যে আপনাকে প্রমাণীকৃত করা হয়েছে এবং প্রজেক্টটি আপনার প্রজেক্ট আইডিতে সেট করা আছে।

  1. আপনি প্রমাণীকৃত কিনা তা নিশ্চিত করতে ক্লাউড শেলে নিম্নলিখিত কমান্ডটি চালান:
gcloud auth list

কমান্ড আউটপুট

 Credentialed Accounts
ACTIVE  ACCOUNT
*       <my_account>@<my_domain.com>

To set the active account, run:
    $ gcloud config set account `ACCOUNT`
  1. gcloud কমান্ডটি আপনার প্রজেক্ট সম্পর্কে জানে কিনা তা নিশ্চিত করতে ক্লাউড শেলে নিম্নলিখিত কমান্ডটি চালান:
gcloud config list project

কমান্ড আউটপুট

[core]
project = <PROJECT_ID>

যদি তা না থাকে, তবে আপনি এই কমান্ডটি দিয়ে এটি সেট করতে পারেন:

gcloud config set project <PROJECT_ID>

কমান্ড আউটপুট

Updated property [core/project].

৩. এপিআই সক্রিয় করুন এবং এনভায়রনমেন্ট ভেরিয়েবল সেট করুন

এই কোডল্যাবটি ব্যবহার শুরু করার আগে, আপনাকে কয়েকটি এপিআই (API) সক্রিয় করতে হবে। এই কোডল্যাবটির জন্য নিম্নলিখিত এপিআইগুলো ব্যবহার করা প্রয়োজন। আপনি নিম্নলিখিত কমান্ডটি চালিয়ে সেই এপিআইগুলো সক্রিয় করতে পারেন:

gcloud services enable run.googleapis.com \
    storage.googleapis.com \
    cloudbuild.googleapis.com \
    videointelligence.googleapis.com \
    aiplatform.googleapis.com

তারপর আপনি এনভায়রনমেন্ট ভেরিয়েবল সেট করতে পারবেন, যেগুলো এই কোডল্যাব জুড়ে ব্যবহৃত হবে।

REGION=<YOUR-REGION>
PROJECT_ID=<YOUR-PROJECT-ID>
PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format='value(projectNumber)')
JOB_NAME=video-describer-job
BUCKET_ID=$PROJECT_ID-video-describer
SERVICE_ACCOUNT="cloud-run-job-video"
SERVICE_ACCOUNT_ADDRESS=$SERVICE_ACCOUNT@$PROJECT_ID.iam.gserviceaccount.com

৪. একটি পরিষেবা অ্যাকাউন্ট তৈরি করুন

ক্লাউড স্টোরেজ, ভার্টেক্স এআই, এবং ভিডিও ইন্টেলিজেন্স এপিআই অ্যাক্সেস করার জন্য আপনি ক্লাউড রান জবের জন্য একটি সার্ভিস অ্যাকাউন্ট তৈরি করবেন।

প্রথমে সার্ভিস অ্যাকাউন্টটি তৈরি করুন।

gcloud iam service-accounts create $SERVICE_ACCOUNT \
  --display-name="Cloud Run Video Scene Image Describer service account"

এরপর সার্ভিস অ্যাকাউন্টটিকে ক্লাউড স্টোরেজ বাকেট এবং ভার্টেক্স এআই এপিআই-গুলোতে অ্যাক্সেস দিন।

# to view & download storage bucket objects
gcloud projects add-iam-policy-binding $PROJECT_ID \
  --member serviceAccount:$SERVICE_ACCOUNT_ADDRESS \
  --role=roles/storage.objectViewer

# to call the Vertex AI imagetext model
gcloud projects add-iam-policy-binding $PROJECT_ID \
  --member serviceAccount:$SERVICE_ACCOUNT_ADDRESS \
  --role=roles/aiplatform.user

৫. একটি ক্লাউড স্টোরেজ বাকেট তৈরি করুন

নিম্নলিখিত কমান্ড ব্যবহার করে একটি ক্লাউড স্টোরেজ বাকেট তৈরি করুন যেখানে আপনি ক্লাউড রান জব দ্বারা প্রক্রিয়াকরণের জন্য ভিডিও আপলোড করতে পারবেন:

gsutil mb -l us-central1 gs://$BUCKET_ID/

[ঐচ্ছিক] আপনি এই নমুনা ভিডিওটি আপনার ডিভাইসে ডাউনলোড করে ব্যবহার করতে পারেন।

gsutil cp gs://cloud-samples-data/video/visionapi.mp4 testvideo.mp4

এখন আপনার ভিডিও ফাইলটি আপনার স্টোরেজ বাকেটে আপলোড করুন।

FILENAME=<YOUR-VIDEO-FILENAME>
gsutil cp $FILENAME gs://$BUCKET_ID

৬. ক্লাউড রান জব তৈরি করুন

প্রথমে, সোর্স কোডের জন্য একটি ডিরেক্টরি তৈরি করুন এবং সেই ডিরেক্টরিতে প্রবেশ করুন।

mkdir video-describer-job && cd $_

এরপর, নিম্নলিখিত বিষয়বস্তু সহ একটি package.json ফাইল তৈরি করুন:

{
  "name": "video-describer-job",
  "version": "1.0.0",
  "private": true,
  "description": "describes the image in every scene for a given video",
  "main": "app.js",
  "author": "Google LLC",
  "license": "Apache-2.0",
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "@google-cloud/storage": "^7.7.0",
    "@google-cloud/video-intelligence": "^5.0.1",
    "axios": "^1.6.2",
    "fluent-ffmpeg": "^2.1.2",
    "google-auth-library": "^9.4.1"
  }
}

এই অ্যাপটিতে উন্নত পাঠযোগ্যতার জন্য বেশ কয়েকটি সোর্স ফাইল রয়েছে। প্রথমে, নিচের বিষয়বস্তু দিয়ে একটি app.js সোর্স ফাইল তৈরি করুন। এই ফাইলটিতে জবটির এন্ট্রি পয়েন্ট এবং অ্যাপটির মূল লজিক রয়েছে।

const bucketName = "<YOUR_BUCKET_ID>";
const videoFilename = "<YOUR-VIDEO-FILENAME>";

const { captureImages } = require("./helpers/imageCapture.js");
const { detectSceneChanges } = require("./helpers/sceneDetector.js");
const { getImageCaption } = require("./helpers/imageCaptioning.js");
const storageHelper = require("./helpers/storage.js");
const authHelper = require("./helpers/auth.js");

const fs = require("fs").promises;
const path = require("path");

const main = async () => {

    try {

        // download the file to locally to the Cloud Run Job instance
        let localFilename = await storageHelper.downloadVideoFile(
            bucketName,
            videoFilename
        );

        // PART 1 - Use Video Intelligence API
        // detect all the scenes in the video & save timestamps to an array

        // EXAMPLE OUTPUT
        // Detected scene changes at the following timestamps:
        // [1, 7, 11, 12]
        let timestamps = await detectSceneChanges(localFilename);
        console.log(
            "Detected scene changes at the following timestamps: ",
            timestamps
        );

        // PART 2 - Use ffmpeg via dockerfile install
        // create an image of each scene change
        // and save to a local directory called "output"
        // returns the base filename for the generated images

        // EXAMPLE OUTPUT
        // creating screenshot for scene:  1 at output/video-filename-1.png
        // creating screenshot for scene:  7 at output/video-filename-7.png
        // creating screenshot for scene:  11 at output/video-filename-11.png
        // creating screenshot for scene:  12 at output/video-filename-12.png
        // returns the base filename for the generated images
        let imageBaseName = await captureImages(localFilename, timestamps);

        // PART 3a - get Access Token to call Vertex AI APIs via REST
        // needed for the image captioning
        // since we're calling the Vertex AI APIs directly
        let accessToken = await authHelper.getAccessToken();
        console.log("got an access token");

        // PART 3b - use Image Captioning to describe each scene per screenshot
        // EXAMPLE OUTPUT
        /*
        [
            {
                timestamp: 1,
                description:
                    "an aerial view of a city with a bridge in the background"
            },
            {
                timestamp: 7,
                description:
                    "a man in a blue shirt sits in front of shelves of donuts"
            },
            {
                timestamp: 11,
                description:
                    "a black and white photo of people working in a bakery"
            },
            {
                timestamp: 12,
                description:
                    "a black and white photo of a man and woman working in a bakery"
            }
        ]; */

        // instantiate the data structure for storing the scene description and timestamp
        // e.g. an array of json objects,
        // [{ timestamp: 5, description: "..." }, ...]
        let scenes = [];

        // for each timestamp, send the image to Vertex AI
        console.log("getting Vertex AI description for each timestamps");
        scenes = await Promise.all(
            timestamps.map(async (timestamp) => {
                let filepath = path.join(
                    "./output",
                    imageBaseName + "-" + timestamp + ".png"
                );

                // get the base64 encoded image bc sending via REST
                const encodedFile = await fs.readFile(filepath, "base64");

                // send each screenshot to Vertex AI for description
                let description = await getImageCaption(
                    accessToken,
                    encodedFile
                );

                return { timestamp: timestamp, description: description };
            })
        );

        console.log("finished collecting all the scenes");
        console.log(scenes);
    } catch (error) {
        //return an error
        console.error("received error: ", error);
    }
};

// Start script
main().catch((err) => {
    console.error(err);
});

এরপর, Dockerfile তৈরি করুন।

# Copyright 2020 Google, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Use the official lightweight Node.js image.
# https://hub.docker.com/_/node
FROM node:20.10.0-slim

# Create and change to the app directory.
WORKDIR /usr/src/app

RUN apt-get update && apt-get install -y ffmpeg

# Copy application dependency manifests to the container image.
# A wildcard is used to ensure both package.json AND package-lock.json are copied.
# Copying this separately prevents re-running npm install on every code change.
COPY package*.json ./

# Install dependencies.
# If you add a package-lock.json speed your build by switching to 'npm ci'.
# RUN npm ci --only=production
RUN npm install --production

# Copy local code to the container image.
COPY . .

# Run the job on container startup.
CMD [ "npm", "start" ]

এবং নির্দিষ্ট কিছু ফাইলকে কন্টেইনারাইজ করা থেকে বিরত রাখতে .dockerignore নামে একটি ফাইল তৈরি করুন।

Dockerfile
.dockerignore
node_modules
npm-debug.log

এখন helpers নামে একটি ফোল্ডার তৈরি করুন। এই ফোল্ডারটিতে ৫টি হেল্পার ফাইল থাকবে।

mkdir helpers
cd helpers

এরপরে, নিম্নলিখিত বিষয়বস্তু সহ একটি sceneDetector.js ফাইল তৈরি করুন। এই ফাইলটি ভিডিওতে কখন দৃশ্য পরিবর্তন হয় তা শনাক্ত করতে ভিডিও ইন্টেলিজেন্স এপিআই (Video Intelligence API) ব্যবহার করে।

const fs = require("fs");
const util = require("util");
const readFile = util.promisify(fs.readFile);
const ffmpeg = require("fluent-ffmpeg");

const Video = require("@google-cloud/video-intelligence");
const client = new Video.VideoIntelligenceServiceClient();

module.exports = {
    detectSceneChanges: async function (downloadedFile) {
        // Reads a local video file and converts it to base64
        const file = await readFile(downloadedFile);
        const inputContent = file.toString("base64");

        // setup request for shot change detection
        const videoContext = {
            speechTranscriptionConfig: {
                languageCode: "en-US",
                enableAutomaticPunctuation: true
            }
        };

        const request = {
            inputContent: inputContent,
            features: ["SHOT_CHANGE_DETECTION"]
        };

        // Detects camera shot changes
        const [operation] = await client.annotateVideo(request);
        console.log("Shot (scene) detection in progress...");
        const [operationResult] = await operation.promise();

        // Gets shot changes
        const shotChanges =
            operationResult.annotationResults[0].shotAnnotations;

        console.log(
            "Shot (scene) changes detected: " + shotChanges.length
        );

        // data structure to be returned
        let sceneChanges = [];

        // for the initial scene
        sceneChanges.push(1);

        // if only one scene, keep at 1 second
        if (shotChanges.length === 1) {
            return sceneChanges;
        }

        // get length of video
        const videoLength = await getVideoLength(downloadedFile);

        shotChanges.forEach((shot, shotIndex) => {
            if (shot.endTimeOffset === undefined) {
                shot.endTimeOffset = {};
            }
            if (shot.endTimeOffset.seconds === undefined) {
                shot.endTimeOffset.seconds = 0;
            }
            if (shot.endTimeOffset.nanos === undefined) {
                shot.endTimeOffset.nanos = 0;
            }

            // convert to a number
            let currentTimestampSecond = Number(
                shot.endTimeOffset.seconds
            );

            let sceneChangeTime = 0;
            // double-check no scenes were detected within the last second
            if (currentTimestampSecond + 1 > videoLength) {
                sceneChangeTime = currentTimestampSecond;
            } else {
                // otherwise, for simplicity, just round up to the next second
                sceneChangeTime = currentTimestampSecond + 1;
            }

            sceneChanges.push(sceneChangeTime);
        });

        return sceneChanges;
    }
};

async function getVideoLength(localFile) {
    let getLength = util.promisify(ffmpeg.ffprobe);
    let length = await getLength(localFile);

    console.log("video length: ", length.format.duration);
    return length.format.duration;
}

এখন imageCapture.js নামে একটি ফাইল তৈরি করুন এবং তাতে নিম্নলিখিত বিষয়বস্তু রাখুন। এই ফাইলটি একটি নোড অ্যাপের ভেতর থেকে ffmpeg কমান্ড চালানোর জন্য fluent-ffmpeg নোড প্যাকেজটি ব্যবহার করে।

const ffmpeg = require("fluent-ffmpeg");
const path = require("path");
const util = require("util");

module.exports = {
    captureImages: async function (localFile, scenes) {
        let imageBaseName = path.parse(localFile).name;

        try {
            for (scene of scenes) {
                console.log("creating screenshot for scene: ", +scene);
                await createScreenshot(localFile, imageBaseName, scene);
            }
        } catch (error) {
            console.log("error gathering screenshots: ", error);
        }

        console.log("finished gathering the screenshots");
        return imageBaseName; // return the base filename for each image
    }
};

async function createScreenshot(localFile, imageBaseName, scene) {
    return new Promise((resolve, reject) => {
        ffmpeg(localFile)
            .screenshots({
                timestamps: [scene],
                filename: `${imageBaseName}-${scene}.png`,
                folder: "output",
                size: "320x240"
            })
            .on("error", () => {
                console.log(
                    "Failed to create scene for timestamp: " + scene
                );
                return reject(
                    "Failed to create scene for timestamp: " + scene
                );
            })
            .on("end", () => {
                return resolve();
            });
    });
}

সবশেষে, imageCaptioning.js নামে একটি ফাইল তৈরি করুন এবং তাতে নিম্নলিখিত বিষয়বস্তু রাখুন। এই ফাইলটি প্রতিটি সিন ইমেজের ভিজ্যুয়াল বর্ণনা পেতে Vertex AI ব্যবহার করে।

const axios = require("axios");
const { GoogleAuth } = require("google-auth-library");

const auth = new GoogleAuth({
    scopes: "https://www.googleapis.com/auth/cloud-platform"
});

module.exports = {
    getImageCaption: async function (token, encodedFile) {
        // this example shows you how to call the Vertex REST APIs directly
        // https://cloud.google.com/vertex-ai/generative-ai/docs/image/image-captioning#get-captions-short
        // https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/image-captioning

        let projectId = await auth.getProjectId();

        let config = {
            headers: {
                "Authorization": "Bearer " + token,
                "Content-Type": "application/json; charset=utf-8"
            }
        };

        const json = {
            "instances": [
                {
                    "image": {
                        "bytesBase64Encoded": encodedFile
                    }
                }
            ],
            "parameters": {
                "sampleCount": 1,
                "language": "en"
            }
        };

        let response = await axios.post(
            "https://us-central1-aiplatform.googleapis.com/v1/projects/" +
                projectId +
                "/locations/us-central1/publishers/google/models/imagetext:predict",
            json,
            config
        );

        return response.data.predictions[0];
    }
};

auth.js নামে একটি ফাইল তৈরি করুন। এই ফাইলটি গুগল অথেন্টিকেশন ক্লায়েন্ট লাইব্রেরি ব্যবহার করে সরাসরি ভার্টেক্স এআই এন্ডপয়েন্টগুলোকে কল করার জন্য প্রয়োজনীয় অ্যাক্সেস টোকেন সংগ্রহ করবে।

const { GoogleAuth } = require("google-auth-library");

const auth = new GoogleAuth({
    scopes: "https://www.googleapis.com/auth/cloud-platform"
});

module.exports = {
    getAccessToken: async function () {
        return await auth.getAccessToken();
    }
};

সবশেষে, storage.js নামে একটি ফাইল তৈরি করুন। এই ফাইলটি ক্লাউড স্টোরেজ ক্লায়েন্ট লাইব্রেরি ব্যবহার করে ক্লাউড স্টোরেজ থেকে একটি ভিডিও ডাউনলোড করবে।

const { Storage } = require("@google-cloud/storage");

module.exports = {
    downloadVideoFile: async function (bucketName, videoFilename) {
        // Creates a client
        const storage = new Storage();

        // keep same name locally
        let localFilename = videoFilename;

        const options = {
            destination: localFilename
        };

        // Download the file
        await storage
            .bucket(bucketName)
            .file(videoFilename)
            .download(options);

        console.log(
            `gs://${bucketName}/${videoFilename} downloaded locally to ${localFilename}.`
        );

        return localFilename;
    }
};

৭. ক্লাউড রান জবটি ডেপ্লয় এবং এক্সিকিউট করুন

প্রথমে, নিশ্চিত করুন যে আপনি আপনার কোডল্যাবের রুট ডিরেক্টরি video-describer-job এ আছেন।

cd .. && pwd

তারপর, ক্লাউড রান জবটি ডেপ্লয় করার জন্য আপনি এই কমান্ডটি ব্যবহার করতে পারেন।

gcloud run jobs deploy $JOB_NAME  --source . --region $REGION

এখন, আপনি নিম্নলিখিত কমান্ডটি চালিয়ে ক্লাউড রান জবটি সম্পাদন করতে পারেন:

gcloud run jobs execute $JOB_NAME

কাজটি সম্পাদন করা শেষ হলে, লগ URI-এর লিঙ্ক পেতে আপনি নিম্নলিখিত কমান্ডটি চালাতে পারেন। (অথবা আপনি ক্লাউড কনসোল ব্যবহার করে সরাসরি ক্লাউড রান জবস-এ গিয়ে লগগুলো দেখতে পারেন।)

gcloud run jobs executions describe <JOB_EXECUTION_ID>

লগগুলিতে আপনি নিম্নলিখিত আউটপুট দেখতে পাবেন:

[{ timestamp: 1, description: 'what is google cloud vision api ? is written on a white background .'},
{ timestamp: 3, description: 'a woman wearing a google cloud vision api shirt sits at a table'},
{ timestamp: 18, description: 'a person holding a cell phone with the words what is cloud vision api on the bottom' }, ...]

৮. অভিনন্দন!

কোডল্যাবটি সম্পন্ন করার জন্য অভিনন্দন!

আমরা ভিডিও ইন্টেলিজেন্স এপিআই , ক্লাউড রান এবং ভার্টেক্স এআই ভিজ্যুয়াল ক্যাপশনিং- এর ডকুমেন্টেশন পর্যালোচনা করার পরামর্শ দিই।

আমরা যা আলোচনা করেছি

  • ডকারফাইল ব্যবহার করে কীভাবে একটি থার্ড-পার্টি বাইনারি ইনস্টল করার জন্য কন্টেইনার ইমেজ তৈরি করতে হয়
  • ক্লাউড রান জবের জন্য একটি সার্ভিস অ্যাকাউন্ট তৈরি করে কীভাবে ন্যূনতম বিশেষাধিকারের নীতি অনুসরণ করে অন্যান্য গুগল ক্লাউড পরিষেবাগুলোকে কল করা যায়
  • ক্লাউড রান জব থেকে ভিডিও ইন্টেলিজেন্স ক্লায়েন্ট লাইব্রেরি কীভাবে ব্যবহার করবেন
  • Vertex AI থেকে প্রতিটি দৃশ্যের ভিজ্যুয়াল বিবরণ পেতে Google API-তে কীভাবে কল করতে হয়

৯. পরিষ্কার করুন

অনিচ্ছাকৃত চার্জ এড়াতে (উদাহরণস্বরূপ, যদি এই ক্লাউড রান জবটি ফ্রি টিয়ারে আপনার মাসিক ক্লাউড রান ইনভোকেশন বরাদ্দের চেয়ে বেশিবার অনিচ্ছাকৃতভাবে চালু হয়), আপনি হয় ক্লাউড রান জবটি অথবা ধাপ ২-এ তৈরি করা প্রজেক্টটি ডিলিট করে দিতে পারেন।

ক্লাউড রান জবটি ডিলিট করতে, https://console.cloud.google.com/run/ ঠিকানায় ক্লাউড রান ক্লাউড কনসোলে যান এবং video-describer-job ফাংশনটি (অথবা $JOB_NAME, যদি আপনি অন্য কোনো নাম ব্যবহার করে থাকেন) ডিলিট করুন।

আপনি যদি পুরো প্রজেক্টটি মুছে ফেলতে চান, তাহলে আপনি https://console.cloud.google.com/cloud-resource-manager -এ গিয়ে, ধাপ ২-এ তৈরি করা প্রজেক্টটি নির্বাচন করে 'ডিলিট' (Delete) বিকল্পটি বেছে নিতে পারেন। প্রজেক্টটি মুছে ফেললে, আপনাকে আপনার ক্লাউড এসডিকে (Cloud SDK)-তে প্রজেক্ট পরিবর্তন করতে হবে। আপনি gcloud projects list চালিয়ে সমস্ত উপলব্ধ প্রজেক্টের তালিকা দেখতে পারেন।