Skip to main content

ThreatScan is an open-source Python package designed to detect potential physical threats in videos

Project description

ThreatScan

ThreatScan is an open-source Python package designed to detect potential physical threats in videos. It leverages the power of video masking autoencoder (VideoMAE) classification models, fine-tuning them to specifically identify events such as fires and other user-defined threats.

Overview

This package provides a streamlined approach to:

  • Utilize pre-trained VideoMAE models: Benefit from state-of-the-art video understanding capabilities.
  • Fine-tune for threat detection: Adapt the base model to accurately classify specific threat events present in video data.
  • Scalable threat analysis: Process video streams or individual video files for real-time or batch analysis.
  • Extensible architecture: Easily integrate custom threat classes and extend the model's capabilities.

Installation

You can install ThreatScan using pip:

pip install threat-scanner

Getting Started

This document outlines the setup and usage instructions for the project.

Setting up your Virtual Environment

It's highly recommended to use a virtual environment to isolate project dependencies. Follow these steps:

  1. Create a virtual environment:

    python3 -m venv .venv
    

    This command creates a new virtual environment in a directory named .venv within your project.

  2. Activate the virtual environment:

    • On macOS and Linux:

      source .venv/bin/activate
      

      Your terminal prompt should now be prefixed with (.venv), indicating that the virtual environment is active.

    • On Windows (Command Prompt):

      .venv\Scripts\activate
      
    • On Windows (PowerShell):

      .venv\Scripts\Activate.ps1
      

Installing Dependencies

Once the virtual environment is activated, install the project's required libraries using pip:

pip install -r requirements.txt

Running the Application

You can run the main application in different modes:

  • Live Feed (Default) To run the application using your default webcam or live video feed:
python3 -m main
  • With a Video File To run the application using a specific video file:
python3 -m threat_scanner.main --source threat_scanner/detector/examples/fire.mp4

Replace threat_scanner/detector/examples/fire.mp4 with the actual path to your video file.

  • With a Custom Model To run the application using a specific trained model:
python3 -m threat_scanner.main --model mymodel/path/etc

Replace mymodel/path/etc with the correct path to your model file.

Training your own model

To train your own data go to Training README

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your improvements.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

threat_scanner-0.1.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

threat_scanner-0.1.2-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file threat_scanner-0.1.2.tar.gz.

File metadata

  • Download URL: threat_scanner-0.1.2.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for threat_scanner-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2fa9e5eed86db5fc914ec245d0a44c4400c5c13cfcc1e580504facf168e8c1ea
MD5 51a6d691910ca0853867e467b06037b4
BLAKE2b-256 ed93f59483b19fc1821805d4312834122b42b6b387499b15db678902b816e0b2

See more details on using hashes here.

File details

Details for the file threat_scanner-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: threat_scanner-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for threat_scanner-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 adc7a8b8227c4060c924c5a423975ba70a32f755668632f81b595d3c0bd9e4bb
MD5 e89dfdf6660e963a86b4e0ec59e89464
BLAKE2b-256 532303940758c2005b223ed629e1e10ec3106d51f668a1b7165e7366c24fa7c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page