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.5.tar.gz (240.3 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.5-py3-none-any.whl (243.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: urban_worm-0.1.5.tar.gz
  • Upload date:
  • Size: 240.3 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.5.tar.gz
Algorithm Hash digest
SHA256 7d3f58ea47a5a1255d5eaadc762b7e4b882be43fb2eec40929091bfe7caf8f59
MD5 6a6686fd009224ebea33f50f0f26b27d
BLAKE2b-256 4d5772e6d9d956fe03fc7d24f7ff7fc4ebf0471c787d3ef2209c48ad53cca718

See more details on using hashes here.

File details

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

File metadata

  • Download URL: urban_worm-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 243.3 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 48c4886ada60c408f10c66ca4cc4d049a4cd9d1ed7c1619ec67caaa8f5bb395e
MD5 6fc6fda9a0258c0777af015fac71c314
BLAKE2b-256 387b3cf6a1fb97a8c7177de6330b1cda2abb05c2173925b1368c68ac78359022

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