Browse Source

Merge branch 'main' of github.com:pharmapsychotic/clip-interrogator into negative

pull/40/head
pharmapsychotic 2 years ago
parent
commit
3f9eb98aed
  1. 8
      README.md
  2. 4
      clip_interrogator.ipynb
  3. 2
      clip_interrogator/__init__.py
  4. 2
      clip_interrogator/clip_interrogator.py
  5. 3
      cog.yaml
  6. 2
      predict.py
  7. 2
      setup.py

8
README.md

@ -33,11 +33,11 @@ python3 -m venv ci_env
Install with PIP Install with PIP
``` ```
# install torch with GPU support for example: # install torch with GPU support for example:
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117 pip3 install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu117
# install blip and clip-interrogator # install clip-interrogator and blip
pip install -e git+https://github.com/pharmapsychotic/BLIP.git@lib#egg=blip pip install clip-interrogator==0.3.3
pip install clip-interrogator==0.3.2 pip install git+https://github.com/pharmapsychotic/BLIP.git
``` ```
You can then use it in your script You can then use it in your script

4
clip_interrogator.ipynb

@ -76,10 +76,6 @@
" print(subprocess.run(['wget', url, '-P', 'cache'], stdout=subprocess.PIPE).stdout.decode('utf-8'))\n", " print(subprocess.run(['wget', url, '-P', 'cache'], stdout=subprocess.PIPE).stdout.decode('utf-8'))\n",
"\n", "\n",
"\n", "\n",
"import sys\n",
"sys.path.append('src/blip')\n",
"sys.path.append('clip-interrogator')\n",
"\n",
"import gradio as gr\n", "import gradio as gr\n",
"from clip_interrogator import Config, Interrogator\n", "from clip_interrogator import Config, Interrogator\n",
"\n", "\n",

2
clip_interrogator/__init__.py

@ -1,4 +1,4 @@
from .clip_interrogator import Interrogator, Config from .clip_interrogator import Interrogator, Config
__version__ = '0.3.2' __version__ = '0.3.3'
__author__ = 'pharmapsychotic' __author__ = 'pharmapsychotic'

2
clip_interrogator/clip_interrogator.py

@ -9,7 +9,7 @@ import time
import torch import torch
from dataclasses import dataclass 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 PIL import Image
from torchvision import transforms from torchvision import transforms
from torchvision.transforms.functional import InterpolationMode from torchvision.transforms.functional import InterpolationMode

3
cog.yaml

@ -15,7 +15,6 @@ build:
- "open_clip_torch==2.7.0" - "open_clip_torch==2.7.0"
- "timm==0.4.12" - "timm==0.4.12"
- "pycocoevalcap==1.2" - "pycocoevalcap==1.2"
run: - "git+https://github.com/pharmapsychotic/BLIP.git"
- git clone https://github.com/salesforce/BLIP /root/blip
predict: "predict.py:Predictor" predict: "predict.py:Predictor"

2
predict.py

@ -2,8 +2,6 @@ import sys
from PIL import Image from PIL import Image
from cog import BasePredictor, Input, Path from cog import BasePredictor, Input, Path
sys.path.append('/root/blip')
from clip_interrogator import Interrogator, Config from clip_interrogator import Interrogator, Config

2
setup.py

@ -5,7 +5,7 @@ from setuptools import setup, find_packages
setup( setup(
name="clip-interrogator", name="clip-interrogator",
version="0.3.2", version="0.3.3",
license='MIT', license='MIT',
author='pharmapsychotic', author='pharmapsychotic',
author_email='me@pharmapsychotic.com', author_email='me@pharmapsychotic.com',

Loading…
Cancel
Save