qubvel-org / segmentation_models.pytorch

Semantic segmentation models with 500+ pretrained convolutional and transformer-based backbones.
https://smp.readthedocs.io/
MIT License
9.58k stars 1.67k forks source link

Unable to extract Metrics #553

Closed pranavsinghps1 closed 2 years ago

pranavsinghps1 commented 2 years ago

I am currently using segmentation-models-pytorch 0.2.1, and tried installing from source as mentioned on the website(https://smp.readthedocs.io/en/latest/metrics.html#module-segmentation_models_pytorch.metrics.functional), But I am unable to use the get_status function,

import segmentation_models_pytorch as smp
dir(smp)
>>output
['DeepLabV3',
 'DeepLabV3Plus',
 'FPN',
 'Linknet',
 'MAnet',
 'Optional',
 'PAN',
 'PSPNet',
 'Unet',
 'UnetPlusPlus',
 '__builtins__',
 '__cached__',
 '__doc__',
 '__file__',
 '__loader__',
 '__name__',
 '__package__',
 '__path__',
 '__spec__',
 '__version__',
 'base',
 'create_model',
 'deeplabv3',
 'encoders',
 'fpn',
 'linknet',
 'losses',
 'manet',
 'pan',
 'pspnet',
 'torch',
 'unet',
 'unetplusplus',
 'utils'] 

When I go in Utils, I see Metrics, but within Metrics, there seems to be no "get_status" as elucidated in the Examples.

dir(smp.utils.metrics)
['Accuracy',
 'Activation',
 'F',
 'Fscore',
 'IoU',
 'Precision',
 'Recall',
 '__builtins__',
 '__cached__',
 '__doc__',
 '__file__',
 '__loader__',
 '__name__',
 '__package__',
 '__spec__',
 'base']
qubvel commented 2 years ago

Try uninstall package and install it again, it is not updated.

StevenLu1204 commented 2 years ago

I still cannot see the get_stats function. The metrics dir is not included in dir(smp).

qubvel commented 2 years ago

What is the command you execute to install/reinstall?

qubvel commented 2 years ago

I have bumped the version in source, its now should be 0.3.0-dev

2649 commented 2 years ago

Just install from the repo directly: pip install git+https://github.com/qubvel/segmentation_models.pytorch

odkken commented 2 years ago

@2649 @qubvel uninstalling and reinstalling from source worked for me.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.