Git Product home page Git Product logo

lifuguan / solov2-mmdet Goto Github PK

View Code? Open in Web Editor NEW
17.0 1.0 2.0 34 KB

This project hosts the code for implementing the SOLOv2 algorithms based on the official project(https://github.com/WXinlong/SOLO). Due to the inheritance designation, it enables developers as well as researchers to integrate into our projects more easily and elegantly.

Python 97.13% Shell 2.87%
pytorch mmdetection instance-segmentation solov2

solov2-mmdet's People

Contributors

lifuguan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

solov2-mmdet's Issues

No module named 'custommd' error

Hi, i'm using the 2.19.0 version of mmdet. when running python ./tools/train.py configs/det/solo/solov2_r50_fpn_coco.py, the model can not import the custommd in the dir .

Traceback (most recent call last):
  File "./tools/train.py", line 190, in <module>
    main()
  File "./tools/train.py", line 92, in main
    cfg = Config.fromfile(args.config)
  File "/home/ubuntu/anaconda3/envs/hyq/lib/python3.7/site-packages/mmcv/utils/config.py", line 337, in fromfile
    import_modules_from_strings(**cfg_dict['custom_imports'])
  File "/home/ubuntu/anaconda3/envs/hyq/lib/python3.7/site-packages/mmcv/utils/misc.py", line 75, in import_modules_from_strings
    import_module(imp)
  File "/home/ubuntu/anaconda3/envs/hyq/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custommd'

But if I create a test.py

from importlib import import_module
import os


custom_imports = dict(
    imports=[
        "custommd.models.detectors.single_stage_ins",
        "custommd.models.detectors.solov2",
        "custommd.models.solov2.mask_feat_head",
        "custommd.models.solov2.solov2_head",
    ],
    allow_failed_imports=False)



def import_modules_from_strings(imports, allow_failed_imports=False):
    """Import modules from the given list of strings.

    Args:
        imports (list | str | None): The given module names to be imported.
        allow_failed_imports (bool): If True, the failed imports will return
            None. Otherwise, an ImportError is raise. Default: False.

    Returns:
        list[module] | module | None: The imported modules.

    Examples:
        >>> osp, sys = import_modules_from_strings(
        ...     ['os.path', 'sys'])
        >>> import os.path as osp_
        >>> import sys as sys_
        >>> assert osp == osp_
        >>> assert sys == sys_
    """
    if not imports:
        return
    single_import = False
    if isinstance(imports, str):
        single_import = True
        imports = [imports]
    if not isinstance(imports, list):
        raise TypeError(
            f'custom_imports must be a list but got type {type(imports)}')
    imported = []
    for imp in imports:
        if not isinstance(imp, str):
            raise TypeError(
                f'{imp} is of type {type(imp)} and cannot be imported.')
        try:
            imported_tmp = import_module(imp)
            print(os.getcwd())
            print(imp)
        except ImportError:
            if allow_failed_imports:
                warnings.warn(f'{imp} failed to import and is ignored.',
                              UserWarning)
                imported_tmp = None
            else:
                raise ImportError
        imported.append(imported_tmp)
    if single_import:
        imported = imported[0]
    return imported


import_modules_from_strings(**custom_imports)

every thing goes well.
Wondering what cause the error?

the show result is error

Hi,Thansk your work.
I am using mmdet-2.23.0 to train solov2 and succuss to get pth model
However,some problem occur when i test model result using demo.py
when i run " python demo.py ./imgs/30208.jpg ./res.jpg ./configs/solo/solo_r101_fpn_3x_coco.py ./SOLO_R101_3x.pth"
the result image show is strange, and other models show same result,why it happen?
30208
image

the result is very strange

HI,Thank you for great job!
Did you run the code with the mmdet(2.19.0)version ? Can you tell me the result on coco test comparision with original solov2 in the paper? IS there a gap?
And i run the solov2 in mmdet(2.19.0)version on cityscapes,the result is very strange,...can not undertstand. Can you give me some advices,Thank you very much.
frankfurt_000000_000576_leftImg8bit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.