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.2.tar.gz (240.2 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.2-py3-none-any.whl (243.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for urban_worm-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a048a7f0abd91e3c0adc26f0db54a12863dce9ebdc42497fd32a5903012bc010
MD5 ee14c17f2fbb41471ce0a376d0e8d81a
BLAKE2b-256 ead91c06c09fbffb68d950c9ca8ad93e69cc1545de9dc7d693dd846d714e99c4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for urban_worm-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2df4455a9b1c0a5949739bf64fd7204ff57f700ddf963307af5cd3335fb89dc9
MD5 2d03cab7f2d083132d4ec9b36a9c8558
BLAKE2b-256 8cfefbd19c68a3614e515a08d5f6f1738652d3f18c4cdd9b385831f8752f6647

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