An Agnostic Computer Vision Framework - Pluggable to any Training Library: Fastai, Pytorch-Lightning with more to come

Overview
logo

An Agnostic Object Detection Framework


tests docs codecov PyPI version Downloads

black license Discord


IceVision is the first agnostic computer vision framework to offer a curated collection with hundreds of high-quality pre-trained models from torchvision, MMLabs, and soon Pytorch Image Models. It orchestrates the end-to-end deep learning workflow allowing to train networks with easy-to-use robust high-performance libraries such as Pytorch-Lightning and Fastai

IceVision Unique Features:

  • Data curation/cleaning with auto-fix

  • Access to an exploratory data analysis dashboard

  • Pluggable transforms for better model generalization

  • Access to hundreds of neural net models

  • Access to multiple training loop libraries

  • Multi-task training to efficiently combine object detection, segmentation, and classification models

Installation

pip install icevision[all]

For more installation options, check our docs.

Important: We currently only support Linux/MacOS.

Quick Example: How to train the Fridge Objects Dataset

Open In Colab image

image

Happy Learning!

If you need any assistance, feel free to:

Join our Forum

Comments
  • Pickle records

    Pickle records

    Option to pickle records so we don't have to parse all data everytime

    This option should be transparent to the user, we can expose it by a optional argument passed to DataParser.

    Always a good discussion is where to store this data. Do it store it relative to the current file? Into /tmp? Or into a .mantisshrimp folder in the home directory?

    Storing relative to the current file is always annoying when using version control, we have to explicitly not add it to checkout

    Example

    COCOParser(data, source, use_cached=True)
    
    enhancement help wanted 
    opened by lgvaz 42
  • Add backbones

    Add backbones

    • I have added the code to support most torchvision bacbones (except alexnet and Densenet)

    I have unit tested the mantisshrimp/backbones/torchvision_backbones.py file.

    How do I test the entire fasterRCNN code I am unsure. Please let me know so that I can test and create PRs next time.

    opened by oke-aditya 35
  • ValueError: Caught ValueError in DataLoader worker process 0.

    ValueError: Caught ValueError in DataLoader worker process 0.

    πŸš€ Feature

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    bug enhancement help wanted 
    opened by arhamzamindar 27
  • RandomSplitter : TypeError: Can't instantiate abstract class WheatParser with abstract methods bboxes, labels

    RandomSplitter : TypeError: Can't instantiate abstract class WheatParser with abstract methods bboxes, labels

    Hi Aditya,

    RandomSplitter is not able to split the train and validation dataset properly from WheatParser. Could you please correct the format ( def filepath(self, o) -> Union[str, Path]: return self.source / f"{o.image_id}.jpg" ) code from WheatParser class from https://www.kaggle.com/okeaditya/fastaiv2-pytorch-lightning-fasterrcnn

    bug 
    opened by rashmimarganiatgithub 25
  • Predict memory leak

    Predict memory leak

    πŸ› Bug

    The prediction contains a reference to the image array. If any stage of the workflow starts accumulating the predictions objects (as it currently happens in COCOMetric this will result in a memory leak.

    COCOMetric currently uses a "quickfix" to make sure the images are not being stored (take a look at accumulate), but we need a more general solution.

    bug help wanted priority-standard 
    opened by lgvaz 22
  • EfficientDet pretrained arch transfer learning

    EfficientDet pretrained arch transfer learning

    πŸ““ New <Tutorial/Example>

    Request for an example

    What is the task? Object detection using transfer learning for the whole architecture. Are there some defined methods to load fastai model and change its head to a different number of classes, similar to this?

    I was able to run the Faster-RCNN example using this example trained on COCO dataset and evaluate its mAP.

    The EfficientDet workflow seems not to be yet ready. Has there been some update on that?

    I was able to create EfficientDet with pretrained encoder and train it myself on COCO. I'm now trying to do transfer learning for a different number of classes. Loading model through fastai, expectedly, throws an error:

    ---------------------------------------------------------------------------
    RuntimeError                              Traceback (most recent call last)
    <ipython-input-22-cf184f01fec3> in <module>
    ----> 1 learn.load('coco_local')
    
    ~/anaconda3/envs/icevision/lib/python3.8/site-packages/fastai/learner.py in load(self, file, with_opt, device, **kwargs)
        293         if self.opt is None: self.create_opt()
        294         file = join_path_file(file, self.path/self.model_dir, ext='.pth')
    --> 295         load_model(file, self.model, self.opt, device=device, **kwargs)
        296         return self
        297 
    
    ~/anaconda3/envs/icevision/lib/python3.8/site-packages/fastai/learner.py in load_model(file, model, opt, with_opt, device, strict)
         47     hasopt = set(state)=={'model', 'opt'}
         48     model_state = state['model'] if hasopt else state
    ---> 49     get_model(model).load_state_dict(model_state, strict=strict)
         50     if hasopt and with_opt:
         51         try: opt.load_state_dict(state['opt'])
    
    ~/anaconda3/envs/icevision/lib/python3.8/site-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict)
       1049 
       1050         if len(error_msgs) > 0:
    -> 1051             raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
       1052                                self.__class__.__name__, "\n\t".join(error_msgs)))
       1053         return _IncompatibleKeys(missing_keys, unexpected_keys)
    
    RuntimeError: Error(s) in loading state_dict for DetBenchTrain:
    	size mismatch for model.class_net.predict.conv_pw.weight: copying a param with shape torch.Size([819, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([99, 64, 1, 1]).
    	size mismatch for model.class_net.predict.conv_pw.bias: copying a param with shape torch.Size([819]) from checkpoint, the shape in current model is torch.Size([99]).
    

    Is this example for a specific model? EfficientDet

    Is this example for a specific dataset? COCO transfer learning


    Don't remove Main issue for examples: #39

    documentation help wanted good first issue example request 
    opened by potipot 22
  • Add `VIAMaskParser` for parsing polygons as mask annotations.

    Add `VIAMaskParser` for parsing polygons as mask annotations.

    In order to do this, I had to remove VIABBoxParser's ability to parse bounding boxes from both rect and polygon shape attributes and assume that rect annotations are for bounding boxes and polygon annotations for masks. If not, then the polygon annotations were added as an additional bbox and this didn't allow it to be parsed due to length mismatch betwen number of boxes and masks.

    I've left some of the older code commented out rather than delete it, will be happy to clean that up after some feedback.

    opened by rsomani95 22
  • Adds new CI, Covers Multiple OS, Python Versions and Packaging

    Adds new CI, Covers Multiple OS, Python Versions and Packaging

    • With the current change I added CI for more OS systems. It is good idea to build on multiple OS before publishing.

    • This technique is taken from PyTorch Lightning.

    • I have added CI for releasing to both PyPi test server and PyPi official. This is again taken from Lightning

    • We need a test to build package as well. And test PyPi releasing with a dummy release.

    opened by oke-aditya 22
  • Improve hub

    Improve hub

    πŸš€ Feature

    Hub came into a lot of reformulations, but it's real essence is becoming clear, a place to share datasets (and more)!

    For a specific dataset, the following functions can be present:

    • Load dataset (obligatory)
    • Implement parser (obligatory)
    • Implement baseline model (optional)
    • Implement metrics (optional)
    • Additional stuff we cannot predict, for example, the user may want to include some visualization functions, some exploratory data-analysis tool, etc... (optional)

    A great place to draw inspiration is huggingface/nlp, where they maintain a collection of datasets.

    While they maintain a very easy to use interface, I think there are some points we can improve.

    huggingface/nlp locks the interface and provide fixed methods for getting the dataset, e.g. load_dataset. This works very well for simple (predicted) use cases, but means that custom (unpredicted) functionality is very hard (or impossible) to implement.

    Instead of implementing the interface ourselves, it's a better idea to leave the implementation to the contributor, the only thing we need to do is provide are "blueprints" for the obligatory and common optional methods.

    For example, in huggingface for getting the pets dataset we would do:

    dataset = load_dataset('pets') #additional arguments can be passed
    

    What I'm proposing would be:

    dataset = hub.pets.load_dataset() #additional arguments can be passed
    

    All datasets on hub would have at least the obligatory functions, plus any optional functions. Discoverability of custom functions would be easy because of autocompletion: hub.pets.<TAB> would show everything available.


    What is really cool about huggingface/nlp is that they figured out a way of automatically testing the users datasets, they automatically generate a sample of data from the contributor dataset and test on that. Awesome.

    @ai-fast-track, @oke-aditya, what do you think?

    enhancement help wanted discussion 
    opened by lgvaz 22
  • Improve show_preds

    Improve show_preds

    πŸš€ Feature

    If targets are available, we could also show how the predictions compare to the targets.

    Maybe a side by side view? Or maybe a difference view between targets and predictions.

    Maybe something like this (from this article): Screenshot 2020-08-06 at 3 54 46 PM

    enhancement help wanted good first issue workflow hacktoberfest 
    opened by lgvaz 20
  • Streamlit integration (local)

    Streamlit integration (local)

    πŸš€ Feature

    We need a quick demo on how to use streamlit with mantisshrimp. The first step in to get it running locally.

    We should also add helpers functions to make the process easier.

    enhancement help wanted priority-high 
    opened by lgvaz 20
  • Added support for already encoded RLEs

    Added support for already encoded RLEs

    Some COCO Datasets already have encoded RLEs so I added support to the parser to handle cases where they are already encoded. I also removed the use of iscrowd as a method of determining wether it is RLE or Polygon data as in my opinion that is not the proper use of that tag in the dictionary as the mask storage method doesn't always correlate with iscrowd.

    Here is the issue that I brought up. https://github.com/airctic/icevision/issues/1165#issue-1513291363

    opened by gatordevin 0
  • Support for EncodedRLE in COCO Dataset

    Support for EncodedRLE in COCO Dataset

    πŸš€ Feature

    Current problem I have a COCO Dataset that is storing segmentation data in the following format.

    "annotations": [
          {
             "segmentation": {
                "size": [
                   512,
                   512
                ],
                "counts": "X]h45f?4M202O1N3N1O01N101O1Oe@HP?7n@No>d0N1O1O2N1N2O1O1N2N1N3M2M3lA^Nh=d1UBbNf=a1XBbNd=`1[BaNd=`1[BaNd=`1[BbNc=n1O1O1O1O1O1O001O1O1O1O10O01O001O1O001O1O1O^MmBY2R=;O1O10XMPC`2o<9O1O1O1O101N1O100O10O0100O01O1N2M2O2O1O100O100O010O1O10O0100O1O1H8K5N2O1N3O101PNWBe1k=WN_BQ1GXO[>JhA4L05NY>JmA1J33MT?1nSe1"
             },
             "area": 11312,
             "iscrowd": 1,
             "image_id": 2,
             "bbox": [
                304,
                351,
                101,
                112
             ],
             "keypoints": [],
             "num_keypoints": 0,
             "category_id": 2,
             "id": 0
          }, ...
    

    It is clear from this that the count value is being stored as an encoded RLE rather than a normal RLE, as ice vision seems to be assuming.

    Best Solution I think the best solution to this problem is to add a check in the COCODatasetParser that determines whether the data being passed in is in the encoded RLE format or just normal RLE format. I understand right now that iscrowd is used to determine whether it is RLE information or just polygon information. I also think this approach is slightly hacky because plenty of COCODatasets arent necessarily storing crowd segmentation data but still use RLE due to the data size advantages. It would be great if this could be detected automatically which I think is pretty reasonable.

    For Polygons you can check wether segmentation is a dict of information or just an array. If it is just an array then that means it is stored as polygon data.

    For RLE data you can check if it is a dict and if the count's value contains a list of ints then you know it is standard RLE.

    For Encoded RLE Data you can check if the information in counts is a String and if it is then you can just immediately provide the Encoded RLE.

    Alternative Solutions

    1. I can most likely modify this before going into icevision by decoding the dataset and using just normal RLEs but that seems like a roundabout way.
    2. I can also change to simply using polygons rather than RLE. Both of these solutions require modifying my existing dataset rather than just adding support.
    enhancement help wanted 
    opened by gatordevin 1
  • Support for pytorch 1.13

    Support for pytorch 1.13

    πŸš€ Feature

    Is your feature request related to a problem? Please describe. Yes, I can't take advantage of MPS

    Describe the solution you'd like Support newer versions of pytorch

    Describe alternatives you've considered I've tried to install pytorch 1.13 but seems that 'nms' isn't available in torchvision.ops.boxes

    enhancement help wanted 
    opened by benjats07 0
  • Fix Installation Using Conda Guide link in CONTRIBUTING.md

    Fix Installation Using Conda Guide link in CONTRIBUTING.md

    The previous Installation Using Conda Guide link in CONTRIBUTING.md did not take the user to the required page

    The link "https://airctic.com/install/#b-installation-using-conda" was replaced with "https://airctic.com/0.12.0/install/#installation-using-conda" and takes us to the proper site in the docs

    opened by DeVcB13d 0
  • Error when loading icevision in colab

    Error when loading icevision in colab

    πŸ› Bug

    Hi there, when I import icevision in colab I get an error: ModuleNotFoundError: No module named 'sahi.model'

    To Reproduce Steps to reproduce the behavior: !pip install icevision[all] from icevision.all import *

    ---------------------------------------------------------------------------
    ModuleNotFoundError                       Traceback (most recent call last)
    [<ipython-input-5-2dc2b878494d>](https://localhost:8080/#) in <module>
    ----> 1 from icevision.all import *
    
    2 frames
    [/usr/local/lib/python3.7/dist-packages/icevision/__init__.py](https://localhost:8080/#) in <module>
          5 from icevision.data import *
          6 from icevision import backbones
    ----> 7 from icevision import models
          8 from icevision.metrics import *
          9 from icevision.visualize import *
    
    [/usr/local/lib/python3.7/dist-packages/icevision/models/__init__.py](https://localhost:8080/#) in <module>
         30 
         31 if SoftDependencies.sahi:
    ---> 32     from icevision.models import inference_sahi
    
    [/usr/local/lib/python3.7/dist-packages/icevision/models/inference_sahi.py](https://localhost:8080/#) in <module>
         12 
         13 
    ---> 14 from sahi.model import DetectionModel
         15 from sahi.prediction import ObjectPrediction
         16 from sahi.predict import get_sliced_prediction as sahi_get_sliced_prediction
    
    ModuleNotFoundError: No module named 'sahi.model'
    

    Screenshots

    Screenshot 2022-11-24 at 15 06 49

    Where it happens:

    • colab (possibly others, but I didn't have a chance to check)
    bug 
    opened by misza222 2
Releases(0.12.0)
  • 0.8.0(May 12, 2021)

    Supports pytorch 1.8

    Added

    • iou_thresholds parameter to COCOMetric
    • SimpleConfusionMatrix Metric
    • Negative samples support for yolov5
    • Negative samples support for mmdetection object detection models

    Changed

    • Breaking: Albumentations aug_tfms defaults.
      • rotate_limit changed from 45 to 15
      • rgb_shift_limit changed from 20 to 10
      • VOC parser uses image sizes from annotation file instead of image
      • bumps fastai to latest version (<2.4)
    Source code(tar.gz)
    Source code(zip)
  • 0.8.0rc1(May 12, 2021)

  • 0.7.1a1(Apr 29, 2021)

  • 0.7.0(Apr 19, 2021)

    [0.7.0]

    BREAKING: API Refactor

    Added

    • Metrics for mmdetection models

    Changed

    • Breaking: Renamed tasks default,detect,classif to common,detection,classification
    • Breaking: Renamed imageid to record_id
    • Breaking: Added parameter is_new to Parser.parse_fields
    • Removed all dependencies on cv2 for visualisation
    • Use new composite API for visualisation - covers user defined task names & multiple tasks
    • Added a ton of visualisation goodies to icevision.visualize.draw_data.draw_sample - user can now
      • use custom fonts
      • control mask thickness
      • control mask blending
      • prettify labels -- show confidence score & capitalise label
      • plot specific and/or exclude specific labels
      • pass in a dictionary mapping labels to specific colors
      • control label height & width padding from bbox edge
      • add border around label for legibility (color is a parameter)

    Breaking:: Rename labels->label_ids, labels_names->labels in LabelsRecordComponent

    • Renamed torchvision resnet backbones:
      • resnet_fpn.resnet18 -> resnet18_fpn
      • resnest_fpn.resnest18 -> resnest18_fpn

    Breaking: Added parameters sample and keep_image to convert_raw_prediction Breaking: Renamed VocXmlParser to VOCBBoxParser and VocMaskParser to VOCMaskParser Breaking: Renamed predict_dl to predict_from_dl

    Source code(tar.gz)
    Source code(zip)
  • 0.7.0rc4(Apr 14, 2021)

  • 0.7.0rc3(Apr 13, 2021)

  • 0.7.0rc2(Mar 29, 2021)

  • 0.7.0rc1(Mar 24, 2021)

  • 0.6.0b1(Jan 27, 2021)

  • 0.5.2(Jan 3, 2021)

  • 0.5.0(Dec 9, 2020)

    [0.5.0]

    Added

    • Keypoints full support: data API, model and training
    • VGG Image Annotator v2 JSON format parser for bboxes
    • figsize parameter to show_record and show_sample

    Changed

    • improved visualisation for small bboxes
    • COCOMetric now returns all metrics from pycocotools
    • makes torchvision models torchscriptable
    Source code(tar.gz)
    Source code(zip)
  • 0.4.0post1(Nov 17, 2020)

  • 0.4.0(Nov 14, 2020)

    [0.4.0]

    Added

    • retinanet: model, dataloaders, predict, ...

    Changed

    • Breaking: models/rcnn renamed to models/torchvision_models
    • tests/models/rcnn renamed to tests/models/torchvision_models
    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Nov 10, 2020)

    Added

    • pytorch 1.7 support, all dependencies updated
    • tutorial with hard negative samples
    • ability to skip record while parsing

    Changed

    • show_preds visual improvement
    Source code(tar.gz)
    Source code(zip)
  • 0.2.2.post2(Nov 3, 2020)

  • 0.2.2.post1(Nov 2, 2020)

  • 0.2.2(Oct 29, 2020)

    [0.2.2]

    Added

    • Cache records after parsing with the new parameter cache_filepath added to Parser.parse (#504)
    • Added pretrained: bool = True argument to both faster_rcnn and mask_rcnn model() methods. (#516)
    • new class EncodedRLEs
    • all masks get converted to EncodedRLEs at parsing time

    Changed

    • Removed warning on autofixing masks
    • RLE default counts is now COCO style
    • renamed Mask.to_erle to Mask.to_erles
    Source code(tar.gz)
    Source code(zip)
  • 0.2.1post1(Oct 20, 2020)

  • 0.2.1(Oct 20, 2020)

  • 0.2.0(Oct 19, 2020)

    IMPORTANT

    • Switched from poetry to setuptools

    Added

    • Function wandb_img_preds to help logging bboxes to wandb
    • wandb as a soft dependency
    • Template code for parsers.SizeMixin if parsers.FilepathMixin is used
    • Get image size without opening image with get_image_size
    • Ability to skip record while parsing with AbortParseRecord
    • Autofix for record: autofix_records function and autofix:bool parameter added to Parser.parse
    • Record class and mixins, create_mixed_record function to help creating Records
    • InvalidDataError for BBox
    • Catches InvalidDataError while parsing data

    Changed

    • Breaking: Unified parsers.SizeMixin functions image_width and image_height into a single function image_width_height
    • Rename Parser SizeMixin fields from width height to image_width image_height

    Deleted

    • Removed CombinedParser, all parsing can be done with the standard Parser
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0b5(Oct 19, 2020)

  • 0.2.0b4(Oct 19, 2020)

  • 0.2.0b3(Oct 14, 2020)

Owner
airctic
ice simple
airctic
Kornia is a open source differentiable computer vision library for PyTorch.

Open Source Differentiable Computer Vision Library

kornia 7.6k Jan 6, 2023
Open Source Computer Vision Library

OpenCV: Open Source Computer Vision Library Resources Homepage: https://opencv.org Courses: https://opencv.org/courses Docs: https://docs.opencv.org/m

OpenCV 65.7k Jan 3, 2023
A dataset handling library for computer vision datasets in LOST-fromat

A dataset handling library for computer vision datasets in LOST-fromat

null 8 Dec 15, 2022
"Very simple but works well" Computer Vision based ID verification solution provided by LibraX.

ID Verification by LibraX.ai This is the first free Identity verification in the market. LibraX.ai is an identity verification platform for developers

LibraX.ai 46 Dec 6, 2022
This is a Computer vision package that makes its easy to run Image processing and AI functions. At the core it uses OpenCV and Mediapipe libraries.

CVZone This is a Computer vision package that makes its easy to run Image processing and AI functions. At the core it uses OpenCV and Mediapipe librar

CVZone 648 Dec 30, 2022
An organized collection of tutorials and projects created for aspriring computer vision students.

A repository created with the purpose of teaching students in BME lab 308A- Hanoi University of Science and Technology

Givralnguyen 5 Nov 24, 2021
Roboflow makes managing, preprocessing, augmenting, and versioning datasets for computer vision seamless.

Roboflow makes managing, preprocessing, augmenting, and versioning datasets for computer vision seamless. This is the official Roboflow python package that interfaces with the Roboflow API.

Roboflow 52 Dec 23, 2022
Aloception is a set of package for computer vision: aloscene, alodataset, alonet.

Aloception is a set of package for computer vision: aloscene, alodataset, alonet.

Visual Behavior 86 Dec 28, 2022
Multi-choice answer sheet correction system using computer vision with opencv & python.

Multi choice answer correction ?? 5 answer sheet samples with a specific solution for detecting answers and sheet correction. ?? By running the soluti

Reza Firouzi 7 Mar 7, 2022
Repository for playing the computer vision apps: People analytics on Raspberry Pi.

play-with-torch Repository for playing the computer vision apps: People analytics on Raspberry Pi. Tools Tested Hardware RasberryPi 4 Model B here, RA

eMHa 1 Sep 23, 2021
This repository summarized computer vision theories.

This repository summarized computer vision theories.

null 3 Feb 4, 2022
SRA's seminar on Introduction to Computer Vision Fundamentals

Introduction to Computer Vision This repository includes basics to : Python Numpy: A python library Git Computer Vision. The aim of this repository is

Society of Robotics and Automation 147 Dec 4, 2022
Using computer vision method to recognize and calcutate the features of the architecture.

building-feature-recognition In this repository, we accomplished building feature recognition using traditional/dl-assisted computer vision method. Th

null 4 Aug 11, 2022
computer vision, image processing and machine learning on the web browser or node.

Image processing and Machine learning labs   computer vision, image processing and machine learning on the web browser or node note Fast Fourier Trans

ryohei tanaka 487 Nov 11, 2022
Omdena-abuja-anpd - Automatic Number Plate Detection for the security of lives and properties using Computer Vision.

Omdena-abuja-anpd - Automatic Number Plate Detection for the security of lives and properties using Computer Vision.

Abdulazeez Jimoh 1 Jan 1, 2022
Python Computer Vision application that allows users to draw/erase on the screen using their webcam.

CV-Virtual-WhiteBoard The Virtual WhiteBoard is a project I made using the OpenCV and Mediapipe Python libraries. Using your index and middle finger y

Stephen Wang 1 Jan 7, 2022
Smart computer vision application

Smart-computer-vision-application Backend : opencv and python Library required:

null 2 Jan 31, 2022
Computer vision applications project (Flask and OpenCV)

Computer Vision Applications Project This project is at it's initial phase. This is all about the implementation of different computer vision techniqu

Suryam Thapa 1 Jan 26, 2022
Image processing is one of the most common term in computer vision

Image processing is one of the most common term in computer vision. Computer vision is the process by which computers can understand images and videos, and how they are stored, manipulated, and retrieve details from them. OpenCV is an open source computer vision image processing library for machine learning, deep leaning and AI application which plays a major role in real-time operation which is very important in today’s systems.

Happy  N. Monday 3 Feb 15, 2022