DEV Community

Cover image for Image Annotation for AI Model training using Pinata
Suyash Srivastava
Suyash Srivastava

Posted on

10 5 5 6 6

Image Annotation for AI Model training using Pinata

This is a submission for the The Pinata Challenge

What I Built

I have built an image annotation application using :

  • FastAPI : Backend
  • Angular: Frontend
  • Pinata : Blob/File Storage

This application would help in doing the annotations of the image dataset. Then these annotations could be exported and be used for AI model training.

Demo

Image description

Image description

My Code

Flow Diagram

Image description

Pinata setup

  • Create an account with Pinata, and fetch the keys.
  • Install and setup .env files
npm i pinata
Enter fullscreen mode Exit fullscreen mode
PINATA_API_KEY=""
PINATA_API_SECRET=""
PINATA_GATEWAY="*.mypinata.cloud"
PINATA_JWT=""
Enter fullscreen mode Exit fullscreen mode
import { PinataSDK } from "pinata";

const pinata = new PinataSDK({
  pinataJwt: "PINATA_JWT",
  pinataGateway: "example-gateway.mypinata.cloud",
});

Enter fullscreen mode Exit fullscreen mode
  • Create methods for Upload & Retrieve Files

Upload File

const file = new File(["hello"], "Testing.txt", { type: "text/plain" });
    const upload = await pinata.upload.file(file);
    console.log(upload);
Enter fullscreen mode Exit fullscreen mode

Retrieve Files

const url = await pinata.gateways.createSignedURL({
        cid: "bafkreib4pqtikzdjlj4zigobmd63lig7u6oxlug24snlr6atjlmlza45dq",
        expires: 1800,
    })
    console.log(url)
Enter fullscreen mode Exit fullscreen mode

Backend & Frontend Code Repo

More Details

Pinata group was created for each project in the application.
Pinata was used for saving the image dataset, with & without annotations. Also the annotation files are saved as JSON on Pinata. Access to the images & Json file is through the signed SDK.

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay