Object Detection and Cropping for Image Metadata Generation
detail.loadingPreview
Automatically detect objects in an image, crop them, and generate structured metadata for search.
About This Workflow
This workflow automates the process of identifying objects within a source image using Cloudflare's Workers AI (DETR ResNet-50 model). It then crops each detected object into a separate image, uploads these cropped images to Cloudinary, and finally indexes the relevant metadata (including source image URL, detected object label, and a link to the cropped image) into Elasticsearch. This creates a searchable database of image content based on detected objects.
Key Features
- Object Detection: Leverages Cloudflare Workers AI for robust object classification.
- Image Cropping: Extracts individual objects based on bounding box data.
- Cloudinary Upload: Stores cropped images for easy access and delivery.
- Elasticsearch Indexing: Creates a searchable index for object-based image retrieval.
- Dynamic Metadata Generation: Includes source image URL, object label, and Cloudinary URL in indexed data.
How To Use
- Set Variables: Configure the
Set Variablesnode with yourCLOUDFLARE_ACCOUNT_ID, desiredmodel(e.g.,@cf/facebook/detr-resnet-50),source_imageURL, andelasticsearch_indexname. - Trigger Workflow: Execute the workflow by clicking "Test workflow" on the
When clicking "Test workflow"node. - Fetch Source Image: The workflow downloads the specified source image.
- Object Classification: The
Use Detr-Resnet-50 Object Classificationnode sends the image to Cloudflare Workers AI to detect objects and their bounding boxes. - Filter Results: The
Filter Score >= 0.9node keeps only detections with a confidence score of 0.9 or higher. - Fetch Source Image Again: The source image is fetched again to be used for cropping.
- Crop Object From Image: For each high-confidence detection, the
Crop Object From Imagenode crops the object from the source image using its bounding box coordinates. - Upload to Cloudinary: The cropped object image is uploaded to Cloudinary.
- Create Docs In Elasticsearch: Metadata, including URLs to the source and cropped images, the object label, and original filename, is sent to Elasticsearch for indexing.
Apps Used
Workflow JSON
{
"id": "0a52c372-1db2-463a-b729-c96bec4d2a13",
"name": "Object Detection and Cropping for Image Metadata Generation",
"nodes": 6,
"category": "AI",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 0a52c372-1db2...
About the Author
SaaS_Connector
Integration Guru
Connecting CRM, Notion, and Slack to automate your life.
Statistics
Related Workflows
Discover more workflows you might like
Build an AI Documentation Expert Chatbot with Gemini RAG
This n8n workflow automates the creation of an AI-powered expert chatbot capable of answering questions based on your documentation. It intelligently ingests, cleans, and processes your knowledge base, preparing it for a Retrieval Augmented Generation (RAG) pipeline with Google Gemini.
Generate Multilingual Image Captions and Overlay
This workflow generates captions for images using Google Gemini and overlays them onto the image, with support for multilingual output.
LangChain Workflow Retriever Example
Demonstrates using LangChain's Retriever QA Chain to query data retrieved from another workflow.