-
Notifications
You must be signed in to change notification settings - Fork 275
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
能否提供一个使用onnx-engine或者pytorch引擎运行onnx模型的案例 #37
Comments
https://github.com/mymagicpower/AIAS/blob/main/1_image_sdks/ocr_v4_sdk/src/main/java/top/aias/ocr/utils/detection/OcrV4Detection.java
Original Email
Sender:"Tong Li"< ***@***.*** >;
Sent Time:2023/12/4 16:35
To:"mymagicpower/AIAS"< ***@***.*** >;
Cc recipient:"Subscribed"< ***@***.*** >;
Subject:[mymagicpower/AIAS] 能否提供一个使用onnx-engine或者pytorch引擎运行onnx模型的案例 (Issue #37)
paddlepaddle-engine
你好,你提供的asr_sdk使用的是paddlepaddle-engine运行
<!-- PaddlePaddle --> <dependency> <groupId>ai.djl.paddlepaddle</groupId> <artifactId>paddlepaddle-engine</artifactId> <version>${djl.version}</version> </dependency> package me.aias.example.utils; import ai.djl.Device; import ai.djl.ndarray.NDArray; import ai.djl.repository.zoo.Criteria; import ai.djl.training.util.ProgressBar; import org.apache.commons.lang3.tuple.Pair; import java.nio.file.Path; import java.nio.file.Paths; /** * * @author Calvin * * @email ***@***.*** **/ public class SpeechRecognition { public SpeechRecognition() {} public Criteria<NDArray, Pair> criteria() { Criteria<NDArray, Pair> criteria = Criteria.builder() .setTypes(NDArray.class, Pair.class) .optModelPath(Paths.get("models/deep_speech.zip")) .optTranslator(new AudioTranslator()) .optEngine("PaddlePaddle") // Use PaddlePaddle engine .optProgress(new ProgressBar()) .build(); return criteria; } }
能否提供一个使用onnx-engine或者pytorch引擎运行onnx模型的案例
1.将paddle模型转为onnx模型
2.使用使用onnx-engine或者pytorch引擎运行onnx模型
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
我接触过ocr识别的案例,但是我不知道1.deepspeech2的paddle模型是否支持转为onnx模型
2.如何将语音数据转为张量输入到模型中
3.如何将模型的输入转为我需要的格式
在djl中张量是NDList
大神能指点一下上面3个问题吗?
此外我发现你的ocr_sdk有一个小问题
虽然在载入模型时指定运行引擎为onnx-engine但是时间运行使用的是pytorch-engine。愿意是translator中的一些方法用到了pytorch引擎。
1.但是对应输入和输出定位处理都是张量运算为什么会依赖pytorch呢?
2.我通过环境变量指定引擎为onnx-engine但是运行时报错
3.既然ocr的模型格式是onnx,能否再不依赖pytorch-engine的情况下运行呢?具体如何修改代码呢?
…On Sun, Dec 3, 2023, 11:04 PM Calvin ***@***.***> wrote:
https://github.com/mymagicpower/AIAS/blob/main/1_image_sdks/ocr_v4_sdk/src/main/java/top/aias/ocr/utils/detection/OcrV4Detection.java
Original Email
Sender:"Tong Li"< ***@***.*** >;
Sent Time:2023/12/4 16:35
To:"mymagicpower/AIAS"< ***@***.*** >;
Cc recipient:"Subscribed"< ***@***.*** >;
Subject:[mymagicpower/AIAS] 能否提供一个使用onnx-engine或者pytorch引擎运行onnx模型的案例
(Issue #37)
paddlepaddle-engine
你好,你提供的asr_sdk使用的是paddlepaddle-engine运行
<!-- PaddlePaddle --> <dependency>
<groupId>ai.djl.paddlepaddle</groupId>
<artifactId>paddlepaddle-engine</artifactId>
<version>${djl.version}</version> </dependency> package
me.aias.example.utils; import ai.djl.Device; import ai.djl.ndarray.NDArray;
import ai.djl.repository.zoo.Criteria; import
ai.djl.training.util.ProgressBar; import
org.apache.commons.lang3.tuple.Pair; import java.nio.file.Path; import
java.nio.file.Paths; /** * * @author Calvin * * @email ***@***.*** **/
public class SpeechRecognition { public SpeechRecognition() {} public
Criteria<NDArray, Pair> criteria() { Criteria<NDArray, Pair> criteria
= Criteria.builder() .setTypes(NDArray.class, Pair.class)
.optModelPath(Paths.get("models/deep_speech.zip")) .optTranslator(new
AudioTranslator()) .optEngine("PaddlePaddle") // Use PaddlePaddle engine
.optProgress(new ProgressBar()) .build(); return criteria; } }
能否提供一个使用onnx-engine或者pytorch引擎运行onnx模型的案例
1.将paddle模型转为onnx模型
2.使用使用onnx-engine或者pytorch引擎运行onnx模型
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
—
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHSKMPP2JJ6SDIU7I35ID23YHWG2LAVCNFSM6AAAAABAFSP63WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZYGEYTCNBVGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
现在都用whisper了
…---原始邮件---
发件人: "Tong ***@***.***>
发送时间: 2023年12月4日(周一) 晚上9:01
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [mymagicpower/AIAS] 能否提供一个使用onnx-engine或者pytorch引擎运行onnx模型的案例 (Issue #37)
我接触过ocr识别的案例,但是我不知道1.deepspeech2的paddle模型是否支持转为onnx模型
2.如何将语音数据转为张量输入到模型中
3.如何将模型的输入转为我需要的格式
在djl中张量是NDList
大神能指点一下上面3个问题吗?
此外我发现你的ocr_sdk有一个小问题
虽然在载入模型时指定运行引擎为onnx-engine但是时间运行使用的是pytorch-engine。愿意是translator中的一些方法用到了pytorch引擎。
1.但是对应输入和输出定位处理都是张量运算为什么会依赖pytorch呢?
2.我通过环境变量指定引擎为onnx-engine但是运行时报错
3.既然ocr的模型格式是onnx,能否再不依赖pytorch-engine的情况下运行呢?具体如何修改代码呢?
On Sun, Dec 3, 2023, 11:04 PM Calvin ***@***.***> wrote:
>
> https://github.com/mymagicpower/AIAS/blob/main/1_image_sdks/ocr_v4_sdk/src/main/java/top/aias/ocr/utils/detection/OcrV4Detection.java
>
>
>
>
>
>
>
>
> Original Email
>
>
>
> Sender:"Tong Li"< ***@***.*** &gt;;
>
> Sent Time:2023/12/4 16:35
>
> To:"mymagicpower/AIAS"< ***@***.*** &gt;;
>
> Cc recipient:"Subscribed"< ***@***.*** &gt;;
>
> Subject:[mymagicpower/AIAS] 能否提供一个使用onnx-engine或者pytorch引擎运行onnx模型的案例
> (Issue #37)
>
>
>
>
>
> paddlepaddle-engine
> 你好,你提供的asr_sdk使用的是paddlepaddle-engine运行
> <!-- PaddlePaddle --&gt; <dependency&gt;
> <groupId&gt;ai.djl.paddlepaddle</groupId&gt;
> <artifactId&gt;paddlepaddle-engine</artifactId&gt;
> <version&gt;${djl.version}</version&gt; </dependency&gt; package
> me.aias.example.utils; import ai.djl.Device; import ai.djl.ndarray.NDArray;
> import ai.djl.repository.zoo.Criteria; import
> ai.djl.training.util.ProgressBar; import
> org.apache.commons.lang3.tuple.Pair; import java.nio.file.Path; import
> java.nio.file.Paths; /** * * @author Calvin * * @email ***@***.*** **/
> public class SpeechRecognition { public SpeechRecognition() {} public
> Criteria<NDArray, Pair&gt; criteria() { Criteria<NDArray, Pair&gt; criteria
> = Criteria.builder() .setTypes(NDArray.class, Pair.class)
> .optModelPath(Paths.get("models/deep_speech.zip")) .optTranslator(new
> AudioTranslator()) .optEngine("PaddlePaddle") // Use PaddlePaddle engine
> .optProgress(new ProgressBar()) .build(); return criteria; } }
> 能否提供一个使用onnx-engine或者pytorch引擎运行onnx模型的案例
> 1.将paddle模型转为onnx模型
> 2.使用使用onnx-engine或者pytorch引擎运行onnx模型
>
> —
> Reply to this email directly, view it on GitHub, or unsubscribe.
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***&gt;
>
> —
> Reply to this email directly, view it on GitHub
> <#37 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AHSKMPP2JJ6SDIU7I35ID23YHWG2LAVCNFSM6AAAAABAFSP63WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZYGEYTCNBVGQ>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
是的.我也在使用whisper但是目前whisper有两个缺点 我想将asr研究明白之后在研究一下tts.你的案例只提供了paddle asr的案例 |
@litongjava onnx运行ocr, 可以参考RapidOCR ASR 可以参考RapidASR |
https://github.com/RapidAI/RapidASR 我使用用过RapidASR,但是它似乎不支持Apple M2 |
python版的应该没问题的,其他语言建议去FunASR 社区问问,里面开发者维护很积极的 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
paddlepaddle-engine
你好,你提供的asr_sdk使用的是paddlepaddle-engine运行
能否提供一个使用onnx-engine或者pytorch引擎运行onnx模型的案例
1.将paddle模型转为onnx模型
2.使用使用onnx-engine或者pytorch引擎运行onnx模型
The text was updated successfully, but these errors were encountered: