{"id":26919075,"url":"https://github.com/prithivsakthiur/fire-detection-siglip2","last_synced_at":"2026-04-28T20:03:06.056Z","repository":{"id":285430681,"uuid":"958118868","full_name":"PRITHIVSAKTHIUR/Fire-Detection-Siglip2","owner":"PRITHIVSAKTHIUR","description":"Fire-Detection-Siglip2 is an image classification vision-language encoder model fine-tuned from google/siglip2-base-patch16-224 for a single-label classification task. It is designed to detect fire, smoke, or normal conditions using the SiglipForImageClassification architecture. ","archived":false,"fork":false,"pushed_at":"2025-03-31T17:18:39.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T18:28:22.633Z","etag":null,"topics":["fire-detection","google","huggingface","huggingface-transformers","image-classification","llama","normal","siglip","siglip2","smoke","vit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PRITHIVSAKTHIUR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-31T17:13:31.000Z","updated_at":"2025-03-31T17:18:42.000Z","dependencies_parsed_at":"2025-03-31T18:28:32.574Z","dependency_job_id":null,"html_url":"https://github.com/PRITHIVSAKTHIUR/Fire-Detection-Siglip2","commit_stats":null,"previous_names":["prithivsakthiur/fire-detection-siglip2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PRITHIVSAKTHIUR/Fire-Detection-Siglip2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRITHIVSAKTHIUR%2FFire-Detection-Siglip2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRITHIVSAKTHIUR%2FFire-Detection-Siglip2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRITHIVSAKTHIUR%2FFire-Detection-Siglip2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRITHIVSAKTHIUR%2FFire-Detection-Siglip2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PRITHIVSAKTHIUR","download_url":"https://codeload.github.com/PRITHIVSAKTHIUR/Fire-Detection-Siglip2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRITHIVSAKTHIUR%2FFire-Detection-Siglip2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32396781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fire-detection","google","huggingface","huggingface-transformers","image-classification","llama","normal","siglip","siglip2","smoke","vit"],"created_at":"2025-04-01T21:24:53.132Z","updated_at":"2026-04-28T20:03:06.036Z","avatar_url":"https://github.com/PRITHIVSAKTHIUR.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n![fxhgdh.png](https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/5Rnksm-CjGsEs6XMZB-su.png)\n\n#  **Fire-Detection-Siglip2**  \n\n\u003e  **Fire-Detection-Siglip2** is an image classification vision-language encoder model fine-tuned from google/siglip2-base-patch16-224 for a single-label classification task. It is designed to detect fire, smoke, or normal conditions using the SiglipForImageClassification architecture.  \n\n    Classification report:\n    \n                  precision    recall  f1-score   support\n    \n            fire     0.9940    0.9881    0.9911      1010\n          normal     0.9892    0.9941    0.9916      1010\n           smoke     0.9990    1.0000    0.9995      1010\n    \n        accuracy                         0.9941      3030\n       macro avg     0.9941    0.9941    0.9941      3030\n    weighted avg     0.9941    0.9941    0.9941      3030\n\n\nThe model categorizes images into three classes:  \n- **Class 0:** \"Fire\" – The image shows active fire.  \n- **Class 1:** \"Normal\" – The image depicts a normal, fire-free environment.  \n- **Class 2:** \"Smoke\" – The image contains visible smoke, indicating potential fire risk.  \n\n# **Run with Transformers🤗**\n\n```python\n!pip install -q transformers torch pillow gradio\n```\n\n```python\nimport gradio as gr\nfrom transformers import AutoImageProcessor\nfrom transformers import SiglipForImageClassification\nfrom transformers.image_utils import load_image\nfrom PIL import Image\nimport torch\n\n# Load model and processor\nmodel_name = \"prithivMLmods/Fire-Detection-Siglip2\"\nmodel = SiglipForImageClassification.from_pretrained(model_name)\nprocessor = AutoImageProcessor.from_pretrained(model_name)\n\ndef fire_detection(image):\n    \"\"\"Classifies an image as fire, smoke, or normal conditions.\"\"\"\n    image = Image.fromarray(image).convert(\"RGB\")\n    inputs = processor(images=image, return_tensors=\"pt\")\n    \n    with torch.no_grad():\n        outputs = model(**inputs)\n        logits = outputs.logits\n        probs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist()\n    \n    labels = model.config.id2label\n    predictions = {labels[i]: round(probs[i], 3) for i in range(len(probs))}\n    \n    return predictions\n\n# Create Gradio interface\niface = gr.Interface(\n    fn=fire_detection,\n    inputs=gr.Image(type=\"numpy\"),\n    outputs=gr.Label(label=\"Detection Result\"),\n    title=\"Fire Detection Model\",\n    description=\"Upload an image to determine if it contains fire, smoke, or a normal condition.\"\n)\n\n# Launch the app\nif __name__ == \"__main__\":\n    iface.launch()\n```\n\n\n# **Intended Use:**  \n\nThe **Fire-Detection-Siglip2** model is designed to classify images into three categories: **fire, smoke, or normal conditions**. It helps in early fire detection and environmental monitoring.  \n\n### Potential Use Cases:  \n- **Fire Safety Monitoring:** Detecting fire and smoke in surveillance footage.  \n- **Early Warning Systems:** Helping in real-time fire hazard detection in public and private areas.  \n- **Disaster Prevention:** Assisting emergency response teams by identifying fire-prone areas.  \n- **Smart Home \u0026 IoT Integration:** Enhancing automated fire alert systems in smart security setups.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprithivsakthiur%2Ffire-detection-siglip2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprithivsakthiur%2Ffire-detection-siglip2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprithivsakthiur%2Ffire-detection-siglip2/lists"}