The flowvision package consists of popular datasets, SOTA computer vision models, layers, utilities, schedulers, advanced data augmentations and common image transformations based on OneFlow.
First install OneFlow, please refer to install-oneflow for more details.
Then install the latest stable release of flowvision
pip install flowvision==0.2.2
Vision Models | Components | Augmentation and Datasets |
|
|
|
Please refer to docs for full API documentation and tutorials
Please refer to ChangeLog for details and release history
We have conducted all the tests under the same setting, please refer to the model page here for more details.
In flowvision we support two ways to create a model.
- Import the target model from
flowvision.models
, e.g., createalexnet
from flowvision
from flowvision.models.alexnet import alexnet
model = alexnet()
# will download the pretrained model
model = alexnet(pretrained=True)
# customize model to fit different number of classes
model = alexnet(num_classes=100)
- Or create model in an easier way by using
ModelCreator
, e.g., createalexnet
model byModelCreator
from flowvision.models import ModelCreator
alexnet = ModelCreator.create_model("alexnet")
# will download the pretrained model
alexnet = ModelCreator.create_model("alexnet", pretrained=True)
# customize model to fit different number of classes
alexnet = ModelCreator.create_model("alexnet", num_classes=100)
ModelCreator.model_table()
returns a tabular results of available models in flowvision
. To check all of pretrained models, pass in pretrained=True
in ModelCreator.model_table()
.
from flowvision.models import ModelCreator
all_pretrained_models = ModelCreator.model_table(pretrained=True)
print(all_pretrained_models)
You can get the results like:
╒════════════════════════════════════════════╤══════════════╕
│ Supported Models │ Pretrained │
╞════════════════════════════════════════════╪══════════════╡
│ alexnet │ true │
├────────────────────────────────────────────┼──────────────┤
│ convmixer_1024_20 │ true │
├────────────────────────────────────────────┼──────────────┤
│ convmixer_1536_20 │ true │
├────────────────────────────────────────────┼──────────────┤
│ convmixer_768_32_relu │ true │
├────────────────────────────────────────────┼──────────────┤
│ crossformer_base_patch4_group7_224 │ true │
├────────────────────────────────────────────┼──────────────┤
│ crossformer_large_patch4_group7_224 │ true │
├────────────────────────────────────────────┼──────────────┤
│ crossformer_small_patch4_group7_224 │ true │
├────────────────────────────────────────────┼──────────────┤
│ crossformer_tiny_patch4_group7_224 │ true │
├────────────────────────────────────────────┼──────────────┤
│ ... │ ... │
├────────────────────────────────────────────┼──────────────┤
│ wide_resnet101_2 │ true │
├────────────────────────────────────────────┼──────────────┤
│ wide_resnet50_2 │ true │
╘════════════════════════════════════════════╧══════════════╛
It is easy to search for model architectures by using Wildcard as below:
from flowvision.models import ModelCreator
all_efficientnet_models = ModelCreator.model_table("**efficientnet**")
print(all_efficientnet_models)
You can get the results like:
╒════════════════════╤══════════════╕
│ Supported Models │ Pretrained │
╞════════════════════╪══════════════╡
│ efficientnet_b0 │ true │
├────────────────────┼──────────────┤
│ efficientnet_b1 │ true │
├────────────────────┼──────────────┤
│ efficientnet_b2 │ true │
├────────────────────┼──────────────┤
│ efficientnet_b3 │ true │
├────────────────────┼──────────────┤
│ efficientnet_b4 │ true │
├────────────────────┼──────────────┤
│ efficientnet_b5 │ true │
├────────────────────┼──────────────┤
│ efficientnet_b6 │ true │
├────────────────────┼──────────────┤
│ efficientnet_b7 │ true │
╘════════════════════╧══════════════╛
ModelCreator.model_list
has similar function as ModelCreator.model_table
but return a list object, which gives the user a more flexible way to check the supported model in flowvision.
- List all models with pretrained weights
from flowvision.models import ModelCreator
all_pretrained_models = ModelCreator.model_list(pretrained=True)
print(all_pretrained_models[:5])
You can get the results like:
['alexnet',
'convmixer_1024_20',
'convmixer_1536_20',
'convmixer_768_32_relu',
'crossformer_base_patch4_group7_224']
- Support wildcard search
from flowvision.models import ModelCreator
all_efficientnet_models = ModelCreator.model_list("**efficientnet**")
print(all_efficientnet_models)
You can get the results like:
['efficientnet_b0',
'efficientnet_b1',
'efficientnet_b2',
'efficientnet_b3',
'efficientnet_b4',
'efficientnet_b5',
'efficientnet_b6',
'efficientnet_b7']
This is a utility library that downloads and prepares public datasets. We do not host or distribute these datasets, vouch for their quality or fairness, or claim that you have license to use the dataset. It is your responsibility to determine whether you have permission to use the dataset under the dataset's license.
If you're a dataset owner and wish to update any part of it (description, citation, etc.), or do not want your dataset to be included in this library, please get in touch through a GitHub issue. Thanks for your contribution to the ML community!