Object are localized but not classified
See original GitHub issue❓ Questions and Help
I fine-tuned Faster R-CNN with backbone FPN-50 on Cityscapes dataset. Objects can be localized accurately but are always classified incorrectly, such as: all ‘car’ => ‘bus’, ‘bus’ => ‘car’ , ‘person’ => ‘truck’, ‘bicycle’ => ‘motorcycle’, etc. predictions.get_field(“labels”) is always incorrect. I don’t know what’s wrong. Please help me!
I fine-tune the network as follow:
- Remove layers having ‘cls_score’ and ‘bbox_pred’, and save model:
model = build_detection_model(cfg)
device = torch.device(cfg.MODEL.DEVICE)
model.to(device)
optimizer = make_optimizer(cfg, model)
scheduler = make_lr_scheduler(cfg, optimizer)
save_to_disk = get_rank() == 0
checkpointer = DetectronCheckpointer(cfg, model, optimizer, scheduler, cfg.OUTPUT_DIR, save_to_disk)
checkpointer.load(cfg.MODEL.WEIGHT, init=True)
checkpointer.save(path_output)
maskrcnn_benchmark/utils/checkpoint.py is modified as:
class Checkpointer(object):
def load(self, f=None, init=False):
if self.has_checkpoint():
# override argument with existing checkpoint
f = self.get_checkpoint_file()
if not f:
# no checkpoint could be found
self.logger.info("No checkpoint found. Initializing model from scratch")
return {}
self.logger.info("Loading checkpoint from {}".format(f))
checkpoint = self._load_file(f)
if init:
checkpoint['model'] = {k.replace('module.', ''): v for k, v in checkpoint['model'].items()
if 'cls_score' not in k and 'bbox_pred' not in k and 'mask_fcn_logits' not in k}
self._load_model(checkpoint)
if "optimizer" in checkpoint and self.optimizer:
self.logger.info("Loading optimizer from {}".format(f))
self.optimizer.load_state_dict(checkpoint.pop("optimizer"))
if "scheduler" in checkpoint and self.scheduler:
self.logger.info("Loading scheduler from {}".format(f))
self.scheduler.load_state_dict(checkpoint.pop("scheduler"))
- Change config file: NUM_CLASSES: 8, for background and 7 object classes
- Load model and train as normal. Here is loss:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:19 (3 by maintainers)
Top Results From Across the Web
Object Localisation without Classification - Cross Validated
I searched a lot for a method to do so, and found resources for achieving localization with classification, but neither do I want...
Read more >Classification, Localization & Detection - Cogneethi
Given an image with one object, we tell what kind of object it is. This is the case of classification. Localization. Next comes...
Read more >Object Localization with Classification in Real-Time | by Shobhit
Object detection is more complicated than classification, which can also identify the objects but doesn't indicate where the object is.
Read more >Localization and Object Detection with Deep Learning
Classification/Recognition: Given an image with an object, find out what that object is. · Localization: Find where the object is and draw a ......
Read more >5 Significant Object Detection Challenges and Solutions
1. Dual priorities: object classification and localization. The first major complication of object detection is its added goal: not only do ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @luisdecker you can check out my repo, have tried to make a cityscapes dataset, similar to matterport repo. Hope this helps!
Mình nhầm ý trên. Hướng dẫn để convert nhé:
cái thứ 3 cấu trúc lại thì sửa lại lệnh run trên là ok