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

Adding a CoreML Export Script to Enhance Community Resources #1782

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

malfihasan
Copy link

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.

@CLAassistant
Copy link

CLAassistant commented Jun 7, 2024

CLA assistant check
All committers have signed the CLA.

nms_spec = ct.proto.Model_pb2.Model()
nms_spec.specificationVersion = 5
for i in range(2):
decoder_output = _model._spec.description.output[i].SerializeToString()
Copy link

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
Copy link

@mbotsu mbotsu Jun 13, 2024

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
Copy link

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")

Copy link

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

@mbotsu
Copy link

mbotsu commented Jun 13, 2024

Hi.

Thanks to PR I was able to convert to CoreML.
When I ran it, I found a bug in the code and unnecessary arguments and imports.

As an additional request, I think it would be even better if the device defaults to CPU and optionally GPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants