Feature Extraction
Edit model card

Model Card: VinVL VisualBackbone

Disclaimer: The model is taken from the official repository, it can be found here: microsoft/scene_graph_benchmark


More info about how to use this model can be found here: michelecafagna26/vinvl-visualbackbone

Quick start: Feature extraction

from scene_graph_benchmark.wrappers import VinVLVisualBackbone

img_file = "scene_graph_bechmark/demo/woman_fish.jpg"

detector = VinVLVisualBackbone()

dets = detector(img_file)

dets contains the following keys: ["boxes", "classes", "scores", "features", "spatial_features"]

You can obtain the full VinVL's visual features by concatenating the "features" and the "spatial_features"

import numpy as np

v_feats = np.concatenate((dets['features'],  dets['spatial_features']), axis=1)
# v_feats.shape = (num_boxes, 2054)


Please consider citing the original project and the VinVL paper

      title={Image Scene Graph Generation (SGG) Benchmark}, 
      author={Xiaotian Han and Jianwei Yang and Houdong Hu and Lei Zhang and Jianfeng Gao and Pengchuan Zhang},

  title={Vinvl: Revisiting visual representations in vision-language models},
  author={Zhang, Pengchuan and Li, Xiujun and Hu, Xiaowei and Yang, Jianwei and Zhang, Lei and Wang, Lijuan and Choi, Yejin and Gao, Jianfeng},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
Downloads last month


Downloads are not tracked for this model. How to track
Inference API
Inference API (serverless) does not yet support pytorch models for this pipeline type.