Skip to main content

Workflow of reproducible multimodal inference for urban environment evaluation.

Project description

image PyPI Downloads PyPI Downloads Docs image

logo

Urban-WORM

Introduction

Urban-WORM (Workflow Of Reproducible Multimodal Inference) is a user-friendly high-level interface that is designed for adding rich and meaningful captions for crowdsourced data with geotags using multimodal models. Urban-WORM can support the batched analysis of images and sounds for investigating urban environments at scales. The investigation may cover topics about building conditions, street appearance, people's activities, etc.

workflow

Features

  • Collect geotagged data (Mapillary street views, Flickr photos, and Freesound audios) via APIs within the proximity of building footprints (or other POIs)
  • Calibrate the orientation of the panorama street views to look at given locations
  • Filter out personal photo using face detection
  • Divide sound recording to multiple clips with given duration
  • Support (batched) multiple data input with multimodal models

Installation

1 install the package

The package urban-worm can be installed with pip:

pip install urban-worm

2 Inference with llama.cpp

To run more pre-quantized models with vision capabilities, please install pre-built version of llama.cpp:

# Windows
winget install llama.cpp

# Mac and Linux
brew install llama.cpp

More information about the installation here

More GGUF models can be found at the Hugging Face pages here and here

3 Inference with Ollama client

Please make sure Ollama is installed before using urban-worm if you plan to rely on Ollama

For Linux, users can also install ollama by running in the terminal:

curl -fsSL https://ollama.com/install.sh | sh

For MacOS, users can also install ollama using brew:

brew install ollama

To install brew, run in the terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Windows users should directly install the Ollama client

To install the development version from this repo:

pip install -e git+https://github.com/billbillbilly/urbanworm.git#egg=urban-worm

Usage

from urbanworm.inference.llama import InferenceOllama

data = InferenceOllama(image = 'docs/data/img_1.jpg')
system = '''
    Your answer should be based only on your observation. 
    The format of your response must include answer (yes/True or no/False), explanation (within 50 words)
'''
prompt = '''
    Is there a tree?
'''

data.llm = "hf.co/ggml-org/InternVL3-8B-Instruct-GGUF:Q8_0"
data.schema = {
    "answer": (bool, ...),
    "explanation": (str, ...)
}
data.one_inference(system=system, prompt=prompt)

More examples can be found here.

To do

v0.1.x:

  • A module for collecting social media data (Flickr and Freesound)
  • A method for inferencing sound recordings

v0.2.x:

  • A web UI providing interactive operation and data visualization

Legal Notice

This repository and its content are provided for educational and research purposes only. By using the information and code provided, users acknowledge that they are using the APIs and models at their own risk and agree to comply with any applicable laws and regulations.

Acknowledgements

The package is heavily built on llama.cpp and Ollama. Credit goes to the developers of these projects.

The functionality about sourcing and processing GIS data and image processing is built on the following open projects. Credit goes to the developers of these projects.

The development of this package is supported and inspired by the city of Detroit.

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

urban_worm-0.1.6.tar.gz (240.4 kB view details)

Uploaded Source

Built Distribution

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

urban_worm-0.1.6-py3-none-any.whl (243.4 kB view details)

Uploaded Python 3

File details

Details for the file urban_worm-0.1.6.tar.gz.

File metadata

  • Download URL: urban_worm-0.1.6.tar.gz
  • Upload date:
  • Size: 240.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for urban_worm-0.1.6.tar.gz
Algorithm Hash digest
SHA256 6834f327d855e7ef585815309fc3612126e594d76dec95ebb59e76c7075d1e28
MD5 df08b55eea918371725559807f086205
BLAKE2b-256 c5f258f60da8e9ca71e785e7aa7a692fd3e3870182d0d9ba8390e6ce44b147db

See more details on using hashes here.

File details

Details for the file urban_worm-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: urban_worm-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 243.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for urban_worm-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 280c3addde78b9c175f0462ab3774ec2c370bbbf83961bff0ecd1b6310f3d45a
MD5 07f5b083240e46c6f2151ea4e80ada6f
BLAKE2b-256 ed6c3a0ff18489046ebb35bb8b32e3d1995aa8c7104a90cbec60fcf2a8a8487f

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