Skip to main content

A python package to determine if an Image is an Advertisement

Project description

Detect Advertisement Images

Usage


pip install adlike
import requests
from PIL import Image

from adlike import ad_openai_clip_vitl_patch14_336

device = "cuda" if torch.cuda.is_available() else "cpu"
model, preprocess = ad_openai_clip_vitl_patch14_336()

url = "https://literacyideas.com/wp-content/uploads/2021/08/christmas_advertising.jpg"
image = Image.open(requests.get(url, stream=True).raw)


with torch.no_grad():
    image = preprocess(img).to(device).unsqueeze(0)
    probs = model(image)

print("Label probs:", probs)  # prints: tensor([[0.9753]])

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

adlike-0.0.3.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adlike-0.0.3-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file adlike-0.0.3.tar.gz.

File metadata

  • Download URL: adlike-0.0.3.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for adlike-0.0.3.tar.gz
Algorithm Hash digest
SHA256 e0809e75b1dfa64d6d423729b0622b3a3b9f9763399d69deada4c2fde95cc9b8
MD5 8c2319b8219b9586ec14f0f03c13708d
BLAKE2b-256 ae6597ca00941c892b938cd86fdb76d479b2e7e79ef74acece93bf86a12c272b

See more details on using hashes here.

File details

Details for the file adlike-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: adlike-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for adlike-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4e5194dfb6014cc72ffdf0a291849e30d697548eb1e85e9912f34d255cab5433
MD5 394432daac7e51d510c9be4a01b938fd
BLAKE2b-256 48568f817128fde9af93206d81a65481f5df825f58e5346ed195e6de559e5113

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