From 4e14c1e3e48e96b661946fe61f89df5f5ae290cf Mon Sep 17 00:00:00 2001 From: Yazhou Cao Date: Mon, 26 Feb 2024 14:31:55 +0800 Subject: [PATCH 1/2] Rename lmm-tools to vision-agent --- README.md | 16 ++++++++-------- docs/index.md | 2 +- pyproject.toml | 10 +++++----- tests/test_data.py | 2 +- {lmm_tools => vision_agent}/__init__.py | 0 {lmm_tools => vision_agent}/config.py | 0 {lmm_tools => vision_agent}/data/__init__.py | 0 {lmm_tools => vision_agent}/data/data.py | 4 ++-- {lmm_tools => vision_agent}/emb/__init__.py | 0 {lmm_tools => vision_agent}/emb/emb.py | 0 {lmm_tools => vision_agent}/lmm/__init__.py | 0 {lmm_tools => vision_agent}/lmm/lmm.py | 6 ++++-- 12 files changed, 21 insertions(+), 19 deletions(-) rename {lmm_tools => vision_agent}/__init__.py (100%) rename {lmm_tools => vision_agent}/config.py (100%) rename {lmm_tools => vision_agent}/data/__init__.py (100%) rename {lmm_tools => vision_agent}/data/data.py (98%) rename {lmm_tools => vision_agent}/emb/__init__.py (100%) rename {lmm_tools => vision_agent}/emb/emb.py (100%) rename {lmm_tools => vision_agent}/lmm/__init__.py (100%) rename {lmm_tools => vision_agent}/lmm/lmm.py (97%) diff --git a/README.md b/README.md index 4c5a0d3c..463e8a50 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ -# Large Multimodal Model Tools -LMM-Tools (Large Multmodal Model Tools) is a minimal library that helps you utilize multimodal models to organize and structure your image data. One of the problems of dealing with image data is it can be difficult to organize and quickly search. For example, you might have a bunch of pictures of houses and want to count how many yellow houses you have, or how many houses with adobe roofs. This library utilizes LMMs to help create these tags or descriptions and allow you to search over them, or use them in a database to do other operations. +# Vision Agent +Vision Agent is a minimal library that helps you utilize multimodal models to organize and structure your image data. One of the problems of dealing with image data is it can be difficult to organize and quickly search. For example, you might have a bunch of pictures of houses and want to count how many yellow houses you have, or how many houses with adobe roofs. This library utilizes LMMs to help create these tags or descriptions and allow you to search over them, or use them in a database to do other operations. ## Getting Started ### LMMs To get started you can create an LMM and start generating text from images. The following code will grab the LLaVA-1.6 34B model and generate a description of the image you pass it. ```python -import lmm_tools as lmt +import vision_agent as va -model = lmt.lmm.get_model("llava") +model = va.lmm.get_model("llava") model.generate("Describe this image", "image.png") >>> "A yellow house with a green lawn." ``` @@ -19,13 +19,13 @@ model.generate("Describe this image", "image.png") You can use the `DataStore` class to store your images, add new metadata to them such as descriptions, and search over different columns. ```python -import lmm_tools as lmt +import vision_agent as va import pandas as pd df = pd.DataFrame({"image_paths": ["image1.png", "image2.png", "image3.png"]}) -ds = lmt.data.DataStore(df) -ds = ds.add_lmm(lmt.lmm.get_model("llava")) -ds = ds.add_embedder(lmt.emb.get_embedder("sentence-transformer")) +ds = va.data.DataStore(df) +ds = ds.add_lmm(va.lmm.get_model("llava")) +ds = ds.add_embedder(va.emb.get_embedder("sentence-transformer")) ds = ds.add_column("descriptions", "Describe this image.") ``` diff --git a/docs/index.md b/docs/index.md index 7d819fef..d6fe9ebd 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,5 +13,5 @@ This library provides a set of tools to help you build applications with Large M First, install the library: ```bash -pip install lmm-tools +pip install vision-agent ``` diff --git a/pyproject.toml b/pyproject.toml index 47283719..755a4645 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,17 +3,17 @@ requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.poetry] -name = "lmm-tools" +name = "vision-agent" version = "0.0.8" -description = "Toolset for Large Multi-Modal Models" +description = "Toolset for Vision Agent" authors = ["Landing AI "] readme = "README.md" -packages = [{include = "lmm_tools"}] +packages = [{include = "vision_agent"}] [tool.poetry.urls] "Homepage" = "https://landing.ai" -"repository" = "https://github.com/landing-ai/lmm-tools" -"documentation" = "https://github.com/landing-ai/lmm-tools" +"repository" = "https://github.com/landing-ai/vision-agent" +"documentation" = "https://github.com/landing-ai/vision-agent" [tool.poetry.dependencies] # main dependency group python = ">=3.10,<4.0" diff --git a/tests/test_data.py b/tests/test_data.py index c67bcc8d..046fc0fb 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -5,7 +5,7 @@ import pandas as pd import pytest -from lmm_tools.data import DataStore, build_data_store +from vision_agent.data import DataStore, build_data_store @pytest.fixture(autouse=True) diff --git a/lmm_tools/__init__.py b/vision_agent/__init__.py similarity index 100% rename from lmm_tools/__init__.py rename to vision_agent/__init__.py diff --git a/lmm_tools/config.py b/vision_agent/config.py similarity index 100% rename from lmm_tools/config.py rename to vision_agent/config.py diff --git a/lmm_tools/data/__init__.py b/vision_agent/data/__init__.py similarity index 100% rename from lmm_tools/data/__init__.py rename to vision_agent/data/__init__.py diff --git a/lmm_tools/data/data.py b/vision_agent/data/data.py similarity index 98% rename from lmm_tools/data/data.py rename to vision_agent/data/data.py index e531629b..98003cdc 100644 --- a/lmm_tools/data/data.py +++ b/vision_agent/data/data.py @@ -12,8 +12,8 @@ from tqdm import tqdm from typing_extensions import Self -from lmm_tools.emb import Embedder -from lmm_tools.lmm import LMM +from vision_agent.emb import Embedder +from vision_agent.lmm import LMM tqdm.pandas() diff --git a/lmm_tools/emb/__init__.py b/vision_agent/emb/__init__.py similarity index 100% rename from lmm_tools/emb/__init__.py rename to vision_agent/emb/__init__.py diff --git a/lmm_tools/emb/emb.py b/vision_agent/emb/emb.py similarity index 100% rename from lmm_tools/emb/emb.py rename to vision_agent/emb/emb.py diff --git a/lmm_tools/lmm/__init__.py b/vision_agent/lmm/__init__.py similarity index 100% rename from lmm_tools/lmm/__init__.py rename to vision_agent/lmm/__init__.py diff --git a/lmm_tools/lmm/lmm.py b/vision_agent/lmm/lmm.py similarity index 97% rename from lmm_tools/lmm/lmm.py rename to vision_agent/lmm/lmm.py index 2bef55fb..0d31cd3d 100644 --- a/lmm_tools/lmm/lmm.py +++ b/vision_agent/lmm/lmm.py @@ -1,9 +1,11 @@ import base64 -import requests from abc import ABC, abstractmethod from pathlib import Path from typing import Any, Dict, List, Optional, Union, cast -from lmm_tools.config import BASETEN_API_KEY, BASETEN_URL + +import requests + +from vision_agent.config import BASETEN_API_KEY, BASETEN_URL def encode_image(image: Union[str, Path]) -> str: From 442eb0991bf13a716ecf8a412c3bd00482d7b851 Mon Sep 17 00:00:00 2001 From: Yazhou Cao Date: Mon, 26 Feb 2024 14:35:34 +0800 Subject: [PATCH 2/2] Fix CI --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 97fbedca..d21d703b 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -42,7 +42,7 @@ jobs: poetry run black --check --diff --color . - name: Type Checking run: | - poetry run mypy lmm_tools + poetry run mypy vision_agent - name: Test with pytest run: | poetry run pytest -v tests