Welcome to CLAMS Python SDK documentation!¶
CLAMS project¶
CLAMS project aims at free and open-source software platform for computational analysis and metadata generation applications for multimedia material. We believe free and open AI-based multimedia processing platform can bring many benefits of technical advancement to libraries, archives, and museums. To achieve interoperability between various computational applications developed be different vendors, which is absolutely necessary for using applications together supported by user-friendly workflow engines, we are also developing JSON-based MultiMedia Interchange Format (MMIF)
clams-python¶
clams-python is a Python implementation of the CLAMS SDK. clams-python provides CLAMS app developers with the following assistance ;
handling MMIF files for input and output specification for CLAMS apps
a base Python class to start developing a CLAMS app
a flask-based wrapper to run a Python CLAMS app as an HTTP web app
cookie-cutter shell command that sets up everything and starts a new CLAMS app project
Start now from Getting Started!¶
For more …¶
What’s New in 1.4.0¶
(Full changelog available in the CHANGELOG.md)
Overview¶
This release introduces three new fields to the app metadata to improve the orchestration and handling of large models within apps.
Additions¶
analyzer_versions: A new app metadata field (complementing the existing analyzer_version) designed to store version strings for multiple models wrapped in a single CLAMS app (see https://github.com/clamsproject/clams-python/issues/251#issuecomment-3566771680 for discussion).
est_gpu_mem_minandest_gpu_mem_typ: New app metadata fields that allow developers to specify estimated GPU memory usage (minimum and typical) for better resource management.
Changes¶
Updated to the latest
mmif-pythonSDK (1.2.1)Profiling storage: Runtime profiling results (CPU/CUDA architecture, running time) are now stored under a new
appProfilingfield in the output view metadata (https://github.com/clamsproject/clams-python/pull/261).Note: This is an experimental field intended primarily for human inspection; its internal structure may change without notice.
View timestamps: The
timestampproperty of views is now updated based on the time when the_annotate()call completes. This ensures all views from a single app execution share a consistent “marker” for easier identification (https://github.com/clamsproject/clams-python/issues/269).Running an app that declares an
est_gpu_mem_minvalue in production mode (--production) will now automatically limit the number of Gunicorn workers spawned to prevent GPU out-of-memory (OOM) errors.VRAM usage record: Apps running on CUDA and
torchnow cache VRAM usage statistics in the local disk cache (typically in$XDG_CACHE_HOME) (https://github.com/clamsproject/clams-python/issues/243). Currently, this information is for logging only, and we plan to add a retrieval API in the future.See current private implementation at https://github.com/clamsproject/clams-python/blob/671560b184a3b73bf417db753d0fa8f1c73d3bda/clams/app/__init__.py#L348-L361