From 1ec6cd9d4562c9a70cd3dd008d7ca244cd911552 Mon Sep 17 00:00:00 2001 From: pharmapsychotic Date: Wed, 4 Jan 2023 12:39:45 -0600 Subject: [PATCH] Update to nicer BLIP packaging --- README.md | 3 +-- clip_interrogator.ipynb | 2 +- clip_interrogator/__init__.py | 2 +- clip_interrogator/clip_interrogator.py | 2 +- cog.yaml | 3 +-- predict.py | 2 -- requirements.txt | 3 ++- setup.py | 2 +- 8 files changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ca819c7..9f4e0c0 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,7 @@ Install with PIP # install torch with GPU support for example: pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117 -# install blip and clip-interrogator -pip install -e git+https://github.com/pharmapsychotic/BLIP.git@lib#egg=blip +# install clip-interrogator pip install clip-interrogator==0.3.2 ``` diff --git a/clip_interrogator.ipynb b/clip_interrogator.ipynb index 167a1c1..9c702b2 100644 --- a/clip_interrogator.ipynb +++ b/clip_interrogator.ipynb @@ -55,7 +55,7 @@ " install_cmds = [\n", " ['pip', 'install', 'gradio'],\n", " ['pip', 'install', 'open_clip_torch'],\n", - " ['pip', 'install', '-e', 'git+https://github.com/pharmapsychotic/BLIP.git@lib#egg=blip'],\n", + " ['pip', 'install', 'git+https://github.com/pharmapsychotic/BLIP.git'],\n", " ['git', 'clone', 'https://github.com/pharmapsychotic/clip-interrogator.git']\n", " ]\n", " for cmd in install_cmds:\n", diff --git a/clip_interrogator/__init__.py b/clip_interrogator/__init__.py index 057cf78..925f76a 100644 --- a/clip_interrogator/__init__.py +++ b/clip_interrogator/__init__.py @@ -1,4 +1,4 @@ from .clip_interrogator import Interrogator, Config -__version__ = '0.3.2' +__version__ = '0.3.3' __author__ = 'pharmapsychotic' \ No newline at end of file diff --git a/clip_interrogator/clip_interrogator.py b/clip_interrogator/clip_interrogator.py index a978e43..f3f3d6c 100644 --- a/clip_interrogator/clip_interrogator.py +++ b/clip_interrogator/clip_interrogator.py @@ -9,7 +9,7 @@ import time import torch from dataclasses import dataclass -from models.blip import blip_decoder, BLIP_Decoder +from blip.models.blip import blip_decoder, BLIP_Decoder from PIL import Image from torchvision import transforms from torchvision.transforms.functional import InterpolationMode diff --git a/cog.yaml b/cog.yaml index 20c411a..638f2c6 100644 --- a/cog.yaml +++ b/cog.yaml @@ -15,7 +15,6 @@ build: - "open_clip_torch==2.7.0" - "timm==0.4.12" - "pycocoevalcap==1.2" - run: - - git clone https://github.com/salesforce/BLIP /root/blip + - "git+https://github.com/pharmapsychotic/BLIP.git" predict: "predict.py:Predictor" diff --git a/predict.py b/predict.py index 3a7d0f9..abceb28 100644 --- a/predict.py +++ b/predict.py @@ -2,8 +2,6 @@ import sys from PIL import Image from cog import BasePredictor, Input, Path -sys.path.append('/root/blip') - from clip_interrogator import Interrogator, Config diff --git a/requirements.txt b/requirements.txt index 735e90b..73b7fea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,5 @@ torchvision Pillow requests tqdm -open_clip_torch \ No newline at end of file +open_clip_torch +git+https://github.com/pharmapsychotic/BLIP.git \ No newline at end of file diff --git a/setup.py b/setup.py index 19525b5..8201892 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import setup, find_packages setup( name="clip-interrogator", - version="0.3.2", + version="0.3.3", license='MIT', author='pharmapsychotic', author_email='me@pharmapsychotic.com',