Downloads · 30 days
11
27% of all-time downloads
beingamanforever/MagCrop-TMRA-v2
MagCrop-TMRA-v2 is a text classification model from beingamanforever. Use it when you need a label for a piece of text. The card lists the license as mit.
TMRA (Task-Multi-Resolution Aggregator) is a BERT-based classifier that automatically determines the granularity level required for Remote Sensing Visual Question Answering tasks. The model classifies input queries in…
Downloads · 30 days
11
27% of all-time downloads
All-time downloads
41
Public
Parameters
110M
439 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors439 MB · 100%
From the Hugging Face model README
TMRA (Task-Multi-Resolution Aggregator) is a BERT-based classifier that automatically determines the granularity level required for Remote Sensing Visual Question Answering tasks. The model classifies input queries into three categories: Image-level, Region-level, or Pixel-level precision requirements.
image: Global scene understanding queriesregion: Localized object detection queriespixel: Fine-grained segmentation queriesTMRA is designed as a preprocessing component for the OmniCrop pipeline, enabling adaptive multi-granular processing of remote sensing imagery based on query semantics.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("beingamanforever/MagCrop-TMRA-v2")
model = AutoModelForSequenceClassification.from_pretrained("beingamanforever/MagCrop-TMRA-v2")
# Classify query
query = "Count the number of white cars in the parking lot"
inputs = tokenizer(query, return_tensors="pt", padding=True, truncation=True)
with torch.no_grad():
outputs = model(**inputs)
prediction = outputs.logits.argmax(-1).item()
granularity_map = {0: "image", 1: "region", 2: "pixel"}
print(f"Predicted Granularity: {granularity_map[prediction]}")
| Query | Predicted Granularity |
|---|---|
| "Describe the overall landscape" | image |
| "Locate the industrial buildings" | region |
| "Segment individual vehicles in the parking area" | pixel |
| "Count the number of tennis courts" | region |
| "What is the color of the central building's roof?" | pixel |