Skip to main content

CFM - model zoo

Project description

CFM-Task-Models

Popular CV models modified for various approaches of Compression for Machines (aka Coding for Machines)

Installation

The easiest way to install CFM-Task-Models is through PyPI, to do this simply use pip install cfm-task-models However, CFM-Task-Models has requirements that currently cannot be handled by pip, thus before using CFM-Task-Models for the first time please run miminstaller.py in your virutal environment. If using poetry consider: poetry run python -m cfm_task_models.miminstaller

Requirements

CFM-Task-Models currently relies on several tools from OpenMMLab, which require custom installation using the openmim installer. Openmim is a tool provided by OpenMMLab which installs their libraries based on the user's pytorch and cuda versions.

See pyproject.toml for standard requirements and miminstaller.py for OpenMMLAB requirements

Using conda

conda env create -f environment.yml

Usage

To test Swin_Transformer, run the following command from the root directory:

python models/Swin-Transformer/models/swin_transformer_v2.py

Semantic Segmentation

Dataset

To downald the ADE20K dataset, run the following command from the root directory:

python cfm_task_models/dataset_download.py --dataset-name ade20k_2016 --save-dir data/ade --unzip --delete

Model Zoo

The model configs can be found in configs/segmentation.

ADE20K dataset

Model Backbone config checkpoint mIoU
UperNet Swin-T UPerNet download model 44.41
Mask2Former Swin-T Mask2Former download model 48.66
KNet + UperNet Swin-T KNet download model 45.84

Download from mim (#archive):

mim download mmsegmentation --config swin-tiny-patch4-window7-in1k-pre_upernet_8xb2-160k_ade20k-512x512 --dest ./configs/segmentation

mim download mmsegmentation --config mask2former_swin-t_8xb2-160k_ade20k-512x512 --dest ./configs/segmentation

mim download mmsegmentation --config knet-s3_swin-t_upernet_8xb2-adamw-80k_ade20k-512x512 --dest ./configs/segmentation

Evaluation

To evaluate the model on the ADE20K dataset, run the following command from the root directory:

python cfm_task_models/run_mmseg_swin_ade20k_eval.py --device cuda --checkpoint path/to/checkpoint --config path/to/config --output result/file/path --data-root path/to/data

For example : python cfm_task_models/run_mmseg_swin_ade20k_eval.py --device cuda --checkpoint checkpoints/mask2former_swin-t_8xb2-160k_ade20k-512x512_20221203_234230-7d64e5dd.pth --config configs/segmentation/mask2former_swin-t_8xb2-160k_ade20k-512x512.py --output result.json --data-root /home/data/ade/ADEChallengeData2016/

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

cfm_task_models-0.1.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

cfm_task_models-0.1.0-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file cfm_task_models-0.1.0.tar.gz.

File metadata

  • Download URL: cfm_task_models-0.1.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.6 Linux/5.15.0-117-generic

File hashes

Hashes for cfm_task_models-0.1.0.tar.gz
Algorithm Hash digest
SHA256 83229597ddc5022b5999ebd45cc566d2391d183dd47ee8746b1a4cbe7d4d2840
MD5 eb8e61514bc3ecefa005c3f61b473df8
BLAKE2b-256 e0ff85ba10bc711fdf0a6f2c29f5658133c19e0fab0e87abffe237c681a69028

See more details on using hashes here.

File details

Details for the file cfm_task_models-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cfm_task_models-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.6 Linux/5.15.0-117-generic

File hashes

Hashes for cfm_task_models-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2df3adf44d1d51a4d5a39da260aa1375d17db685810db97545f0ba9e0ec1654
MD5 2ce0bc52210c1c3c59f28c6374994022
BLAKE2b-256 22d36ee7051d5111f0535fb6ebc0ee32eae91b858409d90b1c31697e90cae993

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page