Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PanopticDeeplab] Update evaluation #2564

Merged
merged 4 commits into from
Sep 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions contrib/PanopticDeepLab/core/val.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@ def evaluate(model,
model.eval()
nranks = paddle.distributed.ParallelEnv().nranks
local_rank = paddle.distributed.ParallelEnv().local_rank
if nranks > 1:
# Initialize parallel environment if not done.
if not paddle.distributed.parallel.parallel_helper._is_parallel_ctx_initialized(
):
paddle.distributed.init_parallel_env()
batch_sampler = paddle.io.DistributedBatchSampler(
batch_sampler = paddle.io.BatchSampler(
eval_dataset, batch_size=1, shuffle=False, drop_last=False)
loader = paddle.io.DataLoader(
eval_dataset,
Expand Down
1 change: 1 addition & 0 deletions contrib/PanopticDeepLab/datasets/cityscapes_panoptic.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class CityscapesPanoptic(paddle.io.Dataset):
small_instance_weight (int, optional): The loss weight for small instance. Default: 1.
stuff_area (int, optional): An Integer, remove stuff whose area is less tan stuff_area. Default: 2048.
"""
NUM_CLASSES = 19

def __init__(self,
transforms,
Expand Down