Comments (33)
I have fixed it by adding: register_all_modules()
from mmyolo.
I have another question, why is pycocotools
a hard dependency for mmyolo
? It is not necessary when doing only inference?
Opened a separate issue: #235
This problem is solved.
from mmyolo.
@fcakyon Temporary solution:
from mmengine.registry import DefaultScope
with DefaultScope.overwrite_default_scope('mmdet'):
self.predictor = init_detector(cfg, cfg.model_path)
from mmyolo.
For slice inference, there's already a huge_image_demo in mmrotate for large image slice inference, maybe we can refactor this feature in mmdet or mmcv to share this feature cross libraries.
Except for slice inference, I also expect there will be a slice evaluate just like coco evaluate in sahi. But evaluate in sahi only support coco, i hope that could support more dataset or more universal.
Slicing training is also a feature I was looking forward to. In DOTA dataset for rotate object detection, all image will be sliced to patches before training and testing, sliced datasets take up a lot of storage space. During paper reproduction, if some papers use a different slice size or strategy, the images need to be sliced again, its a huge burden for my hard drive.
Looking for your suggestion too.
from mmyolo.
Slicing training is also a feature I was looking forward to. In DOTA dataset for rotate object detection, all image will be sliced to patches before training and testing, sliced datasets take up a lot of storage space. During paper reproduction, if some papers use a different slice size or strategy, the images need to be sliced again, its a huge burden for my hard drive.
Creating a sliced dataset and then training on these images is the trivial solution. But if you want to save some disk space, these slicing operation can be performed during training on the fly as an augmentation with the help of dataloader maybe. For each loaded image, crop augmentation can be applied in a structured way (instead of randomly cropping) then these crop augmentations can be input into the model.
from mmyolo.
@hhaAndroid OK will work on it today.
from mmyolo.
I have made great progress, and will be able to open a pr with working large_image_demo.py using sahi
this week ๐
from mmyolo.
Thank you. I have replied
from mmyolo.
Thank you. I have replied
I have resolved your replies, can you check again in your free time? :)
OK
from mmyolo.
I am having this error when trying to download mmyolo config via python: open-mmlab/mim#170
from mmyolo.
I am having this error when trying to download mmyolo config via python: open-mmlab/mim#170
Hi @fcakyon, using mmyolo==0.1.2
will solve this problem.
from mmyolo.
@fcakyon Hi, We plan to integrate sahi in v0.1.3. The current plan is:
- First make a draft in mmyolo to see the generality
- If the generality is very strong, we can consider submitting PR directly to mmengine so that all openmmlab repo can be used directly
Can we write a draft version first and then discuss the next steps?
from mmyolo.
Can we write a draft version first and then discuss the next steps?
Sure ๐
from mmyolo.
@RangeKing when I run this code snippet:
from mmdet.apis import init_detector
config_path = 'yolov5_n-v61_syncbn_fast_8xb16-300e_coco.py'
model_path = 'yolov5_n-v61_syncbn_fast_8xb16-300e_coco_20220919_090739-b804c1ad.pth'
model = init_detector(
config=config_path,
checkpoint=model_path,
device='cuda:0',
)
I get this error:
KeyError: 'YOLODetector is not in the model registry. Please check whether the value of `YOLODetector` is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/tutorials/config.html#import-custom-python-modules'
env:
mmcv 2.0.0rc2 pypi_0 pypi
mmdet 3.0.0rc2 pypi_0 pypi
mmengine 0.3.0 pypi_0 pypi
mmyolo 0.1.2 pypi_0 pypi
Is there any way to use the inference API for mmyolo models?
from mmyolo.
@hhaAndroid I am having another issue:
KeyError: 'LoadImageFromNDArray is not in the transform registry. Please check whether the value of `LoadImageFromNDArray` is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/tutorials/config.html#import-custom-python-modules'
trying to perform inference using inference_detector(self.model, image)
with numpy image.
from mmyolo.
@hhaAndroid now gives the following error during inference:
KeyError: 'YOLOv5KeepRatioResize is not in the transform registry. Please check whether the value of `YOLOv5KeepRatioResize` is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/tutorials/config.html#import-custom-python-modules'
from mmyolo.
@hhaAndroid here is a list of issues I am facing:
Scenario1:
import numpy as np
from mmdet.apis import inference_detector, init_detector
from mmyolo.utils import register_all_modules
from mmengine.registry import DefaultScope
config_path = 'yolov5_n-v61_syncbn_fast_8xb16-300e_coco.py'
model_path = 'yolov5_n-v61_syncbn_fast_8xb16-300e_coco_20220919_090739-b804c1ad.pth'
register_all_modules()
model = init_detector(
config=config_path,
checkpoint=model_path,
device='cuda:0',
)
prediction_result = inference_detector(model, np.random.randn(1, 3, 640, 640))
Error:
KeyError: 'LoadImageFromNDArray is not in the transform registry. Please check whether the value of `LoadImageFromNDArray` is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/tutorials/config.html#import-custom-python-modules'
Scenario2:
import numpy as np
from mmdet.apis import inference_detector, init_detector
from mmyolo.utils import register_all_modules
from mmengine.registry import DefaultScope
config_path = 'yolov5_n-v61_syncbn_fast_8xb16-300e_coco.py'
model_path = 'yolov5_n-v61_syncbn_fast_8xb16-300e_coco_20220919_090739-b804c1ad.pth'
register_all_modules()
with DefaultScope.overwrite_default_scope("mmdet"):
model = init_detector(
config=config_path,
checkpoint=model_path,
device="cuda:0",
)
prediction_result = inference_detector(model, np.random.randn(1, 3, 640, 640))
Error:
'YOLODetector is not in the model registry. Please check whether the value of `YOLODetector` is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/tutorials/config.html#import-custom-python-modules'
Scenario3:
import numpy as np
from mmdet.apis import inference_detector, init_detector
from mmyolo.utils import register_all_modules
from mmengine.registry import DefaultScope
config_path = 'yolov5_n-v61_syncbn_fast_8xb16-300e_coco.py'
model_path = 'yolov5_n-v61_syncbn_fast_8xb16-300e_coco_20220919_090739-b804c1ad.pth'
with DefaultScope.overwrite_default_scope("mmdet"):
register_all_modules()
model = init_detector(
config=config_path,
checkpoint=model_path,
device="cuda:0",
)
prediction_result = inference_detector(model, np.random.randn(1, 3, 640, 640))
Error:
'LoadImageFromNDArray is not in the transform registry. Please check whether the value of `LoadImageFromNDArray` is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/tutorials/config.html#import-custom-python-modules'
Scenario4:
import numpy as np
from mmdet.apis import inference_detector, init_detector
from mmyolo.utils import register_all_modules
from mmengine.registry import DefaultScope
config_path = 'yolov5_n-v61_syncbn_fast_8xb16-300e_coco.py'
model_path = 'yolov5_n-v61_syncbn_fast_8xb16-300e_coco_20220919_090739-b804c1ad.pth'
with DefaultScope.overwrite_default_scope("mmdet"):
register_all_modules()
model = init_detector(
config=config_path,
checkpoint=model_path,
device="cuda:0",
)
prediction_result = inference_detector(model, np.random.randn(1, 3, 640, 640))
Error:
'LoadImageFromNDArray is not in the transform registry. Please check whether the value of `LoadImageFromNDArray` is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/tutorials/config.html#import-custom-python-modules'
Scenario5:
import numpy as np
from mmdet.apis import inference_detector, init_detector
from mmyolo.utils import register_all_modules
from mmengine.registry import DefaultScope
config_path = 'yolov5_n-v61_syncbn_fast_8xb16-300e_coco.py'
model_path = 'yolov5_n-v61_syncbn_fast_8xb16-300e_coco_20220919_090739-b804c1ad.pth'
register_all_modules()
with DefaultScope.overwrite_default_scope("mmdet"):
model = init_detector(
config=config_path,
checkpoint=model_path,
device="cuda:0",
)
prediction_result = inference_detector(model, np.random.randn(1, 3, 640, 640))
Error:
'YOLODetector is not in the model registry. Please check whether the value of `YOLODetector` is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/tutorials/config.html#import-custom-python-modules'
from mmyolo.
@fcakyon I'm very sorry. I didn't realize there were so many problems with cross-library calls now. It seems that overwrite_default_scope
is not working and I have to rely on open-mmlab/mmdetection#9242 to fix it.
from mmyolo.
@fcakyon I'm very sorry. I didn't realize there were so many problems with cross-library calls now. It seems that
overwrite_default_scope
is not working and I have to rely on open-mmlab/mmdetection#9242 to fix it.
Is that update included in mmdet==v3.0.0rc3 or should I install mmdet v3 from source?
from mmyolo.
For slice inference, there's already a huge_image_demo in mmrotate for large image slice inference, maybe we can refactor this feature in mmdet or mmcv to share this feature cross libraries.
yes that would be a great solution
from mmyolo.
Except for slice inference, I also expect there will be a slice evaluate just like coco evaluate in sahi. But evaluate in sahi only support coco, i hope that could support more dataset or more universal.
Actually sahi coco evaluate
is similar to standard coco evaluation. It is not a sliced evaluation. We create coco formatted result.json after merging slice results.
from mmyolo.
Slicing training is also a feature I was looking forward to. In DOTA dataset for rotate object detection, all image will be sliced to patches before training and testing, sliced datasets take up a lot of storage space. During paper reproduction, if some papers use a different slice size or strategy, the images need to be sliced again, its a huge burden for my hard drive.
Creating a sliced dataset and then training on these images is the trivial solution. But if you want to save some disk space, these slicing operation can be performed during training on the fly as an augmentation with the help of dataloader maybe. For each loaded image, crop augmentation can be applied in a structured way (instead of randomly cropping) then these crop augmentations can be input into the model.
A slice dataset wrapper and pipeline may be a good solution, this can solve the preprocess, but how to handle the postprocess such as merge results? should the slicing during evaluation and inference be considered as type of test time augmentation
from mmyolo.
A slice dataset wrapper and pipeline may be a good solution, this can solve the preprocess, but how to handle the postprocess such as merge results? should the slicing during evaluation and inference be considered as type of test time augmentation
You are right, it would be better to handle it as test time augmentation so all slice results are merged back into the original image before performing image evaluation.
from mmyolo.
mmdet==v3.0.0rc3
mmdet==v3.0.0rc3
from mmyolo.
@liuyanyi Thank you very much for your feedback. I think you have a very good idea and it's something we really want to do. I'm not sure how much of a challenge it is for sahi to do this in combination with the OpenMMLab framework? Maybe we have to keep communicating and collaborating. Do we design a draft version of the proposal based on the requirements we have gathered so far? @fcakyon
from mmyolo.
@fcakyon Can you just provide a version that supports image_demo.py?
from mmyolo.
@hhaAndroid @PeterH0323 created a pr adding large image demo using sahi: #284
Tested with yolov5_n-v61_syncbn_fast_8xb16-300e_coco
and works fine.
What are your thoughts?
from mmyolo.
Thank you. I have replied
I have resolved your replies, can you check again in your free time? :)
from mmyolo.
@fcakyon Thank you very much, I made a few comments
from mmyolo.
@hhaAndroid thanks for the feedback. What is your opinion on adding large_image_inference api to mmdet?
from mmyolo.
@fcakyon My suggestion is to let users try it for a month and improve it before migrating to mmdet. What's your opinion?
from mmyolo.
@hhaAndroid sounds great ๐๐ป
from mmyolo.
Was Sahi support added for online training? Is there any examples demonstrating how to use it?
from mmyolo.
Related Issues (20)
- Doc 404 - page not found HOT 1
- Results do not correspond to current coco set HOT 3
- save_param_scheduler is True but self.param_schedulers is None
- support mmcv2.1.0+
- When will the YOLOv9 algorithm go live in the MMYOLO project? HOT 4
- Issue with PPYOLOE+ model output on custom YOLO5CocoDataset with custom classes
- Can't build after following instructions, "#error C++17 or later compatible compiler is required to use ATen." HOT 3
- Integrate with CVAT and Fiftyone for Semi-automatic and Automatic Annotation
- RTMDet annotations incorrectly loaded in test pipeline
- About FPS
- The fps of yolov6_v3_n is very low HOT 5
- Cannot install with CUDA 12.1
- KeyError: 'YOLOv5CocoDataset is not in the mmengine::dataset registry
- testing with the trained model
- fix bug onnx export with nms. Onnx operator WHERE requires inputs of same type
- delete
- ๆจกๅๆต่ฏ้ฎ้ข
- parameters from config are not updated in module
- ERROR: Could not build wheels for mmcv, which is required to install pyproject.toml-based projects HOT 1
- Typo/wrong equation of calculating alignment metric in YOLOv8 documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mmyolo.