Image-Text-to-Text
Transformers
Safetensors
lfm2_vl
vision-language
remote-sensing
illegal-mining
image-classification
conversational
Instructions to use ASTRALK/sentinel-lfm-mining-450m-full-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ASTRALK/sentinel-lfm-mining-450m-full-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ASTRALK/sentinel-lfm-mining-450m-full-v2") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("ASTRALK/sentinel-lfm-mining-450m-full-v2") model = AutoModelForMultimodalLM.from_pretrained("ASTRALK/sentinel-lfm-mining-450m-full-v2") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ASTRALK/sentinel-lfm-mining-450m-full-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ASTRALK/sentinel-lfm-mining-450m-full-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ASTRALK/sentinel-lfm-mining-450m-full-v2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/ASTRALK/sentinel-lfm-mining-450m-full-v2
- SGLang
How to use ASTRALK/sentinel-lfm-mining-450m-full-v2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ASTRALK/sentinel-lfm-mining-450m-full-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ASTRALK/sentinel-lfm-mining-450m-full-v2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ASTRALK/sentinel-lfm-mining-450m-full-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ASTRALK/sentinel-lfm-mining-450m-full-v2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use ASTRALK/sentinel-lfm-mining-450m-full-v2 with Docker Model Runner:
docker model run hf.co/ASTRALK/sentinel-lfm-mining-450m-full-v2
sentinel-lfm — LFM2.5-VL-450M FULL fine-tune v2 (improved recipe)
All-layers fine-tune of LiquidAI/LFM2.5-VL-450M with an improved training recipe over
ASTRALK/sentinel-lfm-mining-450m-full:
(1) all 1965 train patches (no downsampling) + class-weighted loss,
(2) validation-based best-checkpoint selection (balanced accuracy),
(3) weight decay, longer schedule. Replies {"mine_present": true|false}.
Results on the held-out test split (419 patches, 303 pos / 116 neg)
| model | acc | F1 | recall | recall_neg | precision |
|---|---|---|---|---|---|
| base (zero-shot) | 0.7208 | 0.8326 | 0.9604 | 0.0948 | 0.7348 |
| LoRA fine-tuned | 0.7995 | 0.8645 | 0.8845 | 0.5776 | 0.8454 |
| FULL fine-tuned (v1) | 0.8138 | 0.8754 | 0.9043 | 0.5776 | 0.8483 |
| FULL fine-tuned v2 (this) | 0.8353 | 0.8900 | 0.9208 | 0.6121 | 0.8611 |
Training
- FULL fine-tune, 448718848 params, class-weighted loss
- 6 epochs, lr=2e-05 (warmup->cosine), wd=0.01
- best checkpoint by val balanced-acc: epoch 1 (bal_acc=0.7713)
- bf16 autocast + gradient checkpointing, ~25.8 min on H100
Usage
from transformers import AutoProcessor, AutoModelForImageTextToText
from transformers.image_utils import load_image
model = AutoModelForImageTextToText.from_pretrained("ASTRALK/sentinel-lfm-mining-450m-full-v2", dtype="bfloat16", device_map="auto")
proc = AutoProcessor.from_pretrained("ASTRALK/sentinel-lfm-mining-450m-full-v2")
img = load_image("patch.png")
conv = [{"role":"user","content":[
{"type":"image","image":img},
{"type":"text","text":'Does this satellite patch show illegal mining? Reply with only this JSON: {"mine_present": true} or {"mine_present": false}'}]}]
inp = proc.apply_chat_template(conv, add_generation_prompt=True, return_tensors="pt", return_dict=True, tokenize=True).to(model.device)
print(proc.decode(model.generate(**inp, max_new_tokens=16)[0][inp["input_ids"].shape[1]:], skip_special_tokens=True))
- Downloads last month
- 10
Model tree for ASTRALK/sentinel-lfm-mining-450m-full-v2
Base model
LiquidAI/LFM2.5-350M-Base Finetuned
LiquidAI/LFM2.5-350M Finetuned
LiquidAI/LFM2.5-VL-450M