Skip to main content

Argus Vision

argusvision package provides easy to use access to image embedding models pretrained on Bing data - Argus Vision models. Interface is based on popular torchvision.

In version 1.0, supported model is Argus Vision V6 - resnext101 32x8d

Please note that provided models are offering image embeddings

Installation

pip install argusvision

For Windows, torch needs to be install from wheel file. Please download the latest torch from here: https://download.pytorch.org/whl/torch_stable.html and then install it using: pip install <.whl file>

Usage

Input images should be in BGR format of shape (3 x H x W), where H and W are expected to be at least 224. The images have to be loaded in to a range of [0, 1] and then normalized using mean = [0.485, 0.456, 0.406] and std = [0.229, 0.224, 0.225].

Example script:

import argusvision
import torch

# This will load pretrained model
model = argusvision.models.resnext101_32x8d()

# This will initialize weights with default values
model = argusvision.models.resnext101_32x8d(pretrained=False) 

# Load model to CPU memory, interface is the same as torchvision
model = argusvision.resnext101_32x8d(map_location=torch.device('cpu')) 

Example of creating image embeddings:

import argusvision
from torchvision import transforms
import torch
from PIL import Image

def get_image():
    img = cv2.imread('example.jpg', cv2.IMREAD_COLOR)
    img = cv2.resize(img, (256, 256))
    img = img[16:256-16, 16:256-16]
    preprocess = transforms.Compose([
        transforms.ToTensor(),
        transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
    ])
    return preprocess(image).unsqueeze(0) # Unsqueeze only required when there's 1 image in images batch

model = argusvision.models.resnext101_32x8d(map_location=torch.device('cpu'))
features = model(get_image())
print(features.shape)

Should output

...
torch.Size([1, 2048])

Benchmarks

Here are the evaluations of the popular datasets

Model CIFAR-10 STL-10
Torchvision, ResNext101 32x8d 90% 81.1%
Argusvision, ResNext101 32x8d 92.6% 84.2%

Metadata

Release files for argusvision 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for argusvision 1.1.0
File Size Uploaded
argusvision-1.1.0.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for argusvision 1.1.0
File Interpreter ABI Platform
argusvision-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / argusvision-1.1.0.tar.gz

Download URL argusvision-1.1.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
76244201c24bfa07f3774e2826c1557fe594434bde301c64c0e7138c22e1091b
BLAKE2b-256 checksum
How to use checksums
5a16aa69bfb35945d74c8acf90edd5fcb3586b4c3699d676ba5b79a632e44b25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

Release files / argusvision-1.1.0-py3-none-any.whl

Download URL argusvision-1.1.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22b9782afca5b0a6270a1084512a784ca0fcd2f6ed641f4e77c9a6365a046a71
BLAKE2b-256 checksum
How to use checksums
776c8eb7426be5b2db2631d28fb5387264e83a511254daeb905dbe9c486c1e00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page