Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mjq2020 authored Aug 19, 2023
2 parents 679aaa1 + f3df859 commit c33d1d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions configs/classification/mobnetv2_1.0_1bx16_300e_cifar10.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# optimizer
lr = 0.01
epochs = 300
epochs = 100

model = dict(
type='edgelab.ImageClassifier',
Expand Down Expand Up @@ -93,7 +93,7 @@
type='MultiStepLR',
begin=1,
end=500,
milestones=[100, 200, 250],
milestones=[30, 60, 90],
gamma=0.1,
by_epoch=True,
),
Expand Down
2 changes: 1 addition & 1 deletion configs/classification/mobnetv2_1.0_1bx16_300e_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# optimizer
lr = 0.01
epochs = 300
epochs = 100

data_preprocessor = dict(
type='mmcls.ClsDataPreprocessor',
Expand Down
4 changes: 4 additions & 0 deletions edgelab/utils/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import torch
from mmdet.models.utils import samplelist_boxtype2tensor
from mmengine.config import Config

from mmengine import dump as resultdump

from mmengine.evaluator import Evaluator
from mmengine.registry import MODELS
from mmengine.structures import InstanceData
Expand Down Expand Up @@ -268,6 +270,7 @@ def __init__(
self.dataloader = dataloader

self.cfg = cfg

if 'fomo' in self.cfg.visualizer:
self.fomo = self.cfg.visualizer.fomo
else:
Expand Down Expand Up @@ -402,6 +405,7 @@ def test(self) -> None:
metrics = self.evaluator.evaluate(len(self.dataloader.dataset))
if self.dump is not None and metrics is not None:
resultdump(metrics, self.dump)

if len(P):
print('P:', sum(P) / len(P))
print('R:', sum(R) / len(R))
Expand Down

0 comments on commit c33d1d1

Please sign in to comment.