-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Adding a CoreML Export Script to Enhance Community Resources #1782
base: main
Are you sure you want to change the base?
Conversation
nms_spec = ct.proto.Model_pb2.Model() | ||
nms_spec.specificationVersion = 5 | ||
for i in range(2): | ||
decoder_output = _model._spec.description.output[i].SerializeToString() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_model._spec.description change spec.description.output
import os | ||
from loguru import logger | ||
import sys | ||
import torch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add import torch.nn as nn
import torch | ||
from yolox.exp import get_exp | ||
from yolox.models.network_blocks import SiLU | ||
from yolox.utils import replace_modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contains unused imports
parser.add_argument("opts", nargs=argparse.REMAINDER, help="Modify config options using the command-line") | ||
parser.add_argument("--decode_in_inference", action="store_true", help="Decode in inference or not") | ||
parser.add_argument("--class_name", type=str, default=None, help="Class name for the object") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are unused arguments
- dynamic
- no-onnxsim
- decode_in_inference
Hi. Thanks to PR I was able to convert to CoreML. As an additional request, I think it would be even better if the device defaults to CPU and optionally GPU. |
I have been working on a CoreML project as a personal endeavor. I believe it could be beneficial to the community, so I am adding a coreml_export.py script for everyone's use. The script is added to tools/coreml_export.py.