Commit 5a372d05 authored by Kai Chen's avatar Kai Chen
Browse files

bug fix and update examples

parent 6e8d925e
...@@ -8,7 +8,7 @@ before_install: ...@@ -8,7 +8,7 @@ before_install:
- sudo apt-get install -y ffmpeg - sudo apt-get install -y ffmpeg
install: install:
- pip install opencv-python pyyaml codecov - pip install opencv-python pyyaml codecov flake8
cache: cache:
pip: true pip: true
...@@ -23,6 +23,8 @@ python: ...@@ -23,6 +23,8 @@ python:
- "3.5" - "3.5"
- "3.6" - "3.6"
before_script: flake8
script: coverage run --source=mmcv setup.py test script: coverage run --source=mmcv setup.py test
after_success: codecov after_success: codecov
\ No newline at end of file
# copied from https://github.com/kuangliu/pytorch-cifar/blob/master/models/resnet.py # copied from
# https://github.com/kuangliu/pytorch-cifar/blob/master/models/resnet.py
import torch.nn as nn import torch.nn as nn
import torch.nn.functional as F import torch.nn.functional as F
......
...@@ -8,7 +8,7 @@ import torch.distributed as dist ...@@ -8,7 +8,7 @@ import torch.distributed as dist
import torch.multiprocessing as mp import torch.multiprocessing as mp
import torch.nn.functional as F import torch.nn.functional as F
from mmcv import Config from mmcv import Config
from mmcv.torchpack import Runner, DistSamplerSeedHook from mmcv.runner import Runner, DistSamplerSeedHook
from torch.nn.parallel import DataParallel, DistributedDataParallel from torch.nn.parallel import DataParallel, DistributedDataParallel
from torch.utils.data import DataLoader from torch.utils.data import DataLoader
from torch.utils.data.distributed import DistributedSampler from torch.utils.data.distributed import DistributedSampler
......
import functools
from .handlers import BaseFileHandler, JsonHandler, PickleHandler, YamlHandler from .handlers import BaseFileHandler, JsonHandler, PickleHandler, YamlHandler
from ..utils import is_str, is_list_of from ..utils import is_str, is_list_of
......
...@@ -8,8 +8,8 @@ import torch ...@@ -8,8 +8,8 @@ import torch
from . import hooks from . import hooks
from .log_buffer import LogBuffer from .log_buffer import LogBuffer
from .hooks import (Hook, LrUpdaterHook, CheckpointHook, IterTimerHook, from .hooks import (Hook, LrUpdaterHook, CheckpointHook, IterTimerHook,
OptimizerHook) OptimizerHook, lr_updater)
from .io import load_checkpoint, save_checkpoint from .checkpoint import load_checkpoint, save_checkpoint
from .utils import get_dist_info, get_host_info, get_time_str, obj_from_dict from .utils import get_dist_info, get_host_info, get_time_str, obj_from_dict
...@@ -331,7 +331,7 @@ class Runner(object): ...@@ -331,7 +331,7 @@ class Runner(object):
self.register_hook(lr_config) self.register_hook(lr_config)
elif isinstance(lr_config, dict): elif isinstance(lr_config, dict):
assert 'policy' in lr_config assert 'policy' in lr_config
from ..hooks import lr_updater # from .hooks import lr_updater
hook_name = lr_config['policy'].title() + 'LrUpdaterHook' hook_name = lr_config['policy'].title() + 'LrUpdaterHook'
if not hasattr(lr_updater, hook_name): if not hasattr(lr_updater, hook_name):
raise ValueError('"{}" does not exist'.format(hook_name)) raise ValueError('"{}" does not exist'.format(hook_name))
......
import functools import functools
import logging
import sys import sys
import time import time
from getpass import getuser from getpass import getuser
......
...@@ -83,7 +83,8 @@ def imshow_det_bboxes(img, ...@@ -83,7 +83,8 @@ def imshow_det_bboxes(img,
Args: Args:
img (str or ndarray): The image to be displayed. img (str or ndarray): The image to be displayed.
bboxes (ndarray): Bounding boxes (with scores), shaped (n, 4) or (n, 5). bboxes (ndarray): Bounding boxes (with scores), shaped (n, 4) or
(n, 5).
labels (ndarray): Labels of bboxes. labels (ndarray): Labels of bboxes.
class_names (list[str]): Names of each classes. class_names (list[str]): Names of each classes.
score_thr (float): Minimum score of bboxes to be shown. score_thr (float): Minimum score of bboxes to be shown.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment