bimm

Crates.iobimm
lib.rsbimm
version0.3.7
created_at2025-06-26 09:31:27.313926+00
updated_at2025-09-23 23:23:21.171159+00
descriptionburn image models
homepage
repositoryhttps://github.com/crutcher/bimm
max_upload_size
id1727086
size590,710
Crutcher Dunnavant (crutcher)

documentation

https://docs.rs/bimm/latest/

README

Burn Image Models

Crates.io Version docs.rs

This is a Rust crate for image models, inspired by the Python timm package.

Examples of loading pretrained model:

use burn::backend::Wgpu;
use bimm::cache::disk::DiskCacheConfig;
use bimm::models::resnet::{PREFAB_RESNET_MAP, ResNet};

let device = Default::default();

let prefab = PREFAB_RESNET_MAP.expect_lookup_prefab("resnet18");

let weights = prefab
    .expect_lookup_pretrained_weights("tv_in1k")
    .fetch_weights(&DiskCacheConfig::default())
    .expect("Failed to fetch weights");

let model: ResNet<Wgpu> = prefab
    .to_config()
    .to_structure()
    .init(&device)
    .load_pytorch_weights(weights)
    .expect("Failed to load weights")
    // re-head the model to 10 classes:
    .with_classes(10)
    // Enable (drop_block_prob) stochastic block drops for training:
    .with_stochastic_drop_block(0.2)
    // Enable (drop_path_prob) stochastic depth for training:
    .with_stochastic_path_depth(0.1);

Recent Changes

  • 0.3.3
    • Preview of ResNet-18 support.
  • 0.3.2
    • Fixed visibility for DropBlock3d / drop_block_3d support.
  • 0.3.1
    • added DropBlock2d / drop_block_2d support.
  • 0.2.0
    • bumped burn dependency to 0.18.0.
Commit count: 409

cargo fmt