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 threatscan

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 main --source threatscan/detector/examples/fire.mp4

Replace threatscan/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 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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

threat_scanner-0.1.1-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: threat_scanner-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 125fc45e0a2272c9eddfde3047f46a049dc1d6a079faf5e0172e4e7f2c832d5b
MD5 f82cae6d87216db8efea719831e8a029
BLAKE2b-256 42d5a5a958cc92d7ffdad6eda3c45a729327c8ef40fb7ee3700a32f1383c6260

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