generated from RageAgainstThePixel/upm-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
com.rest.huggingface 1.0.0-preview.8 (#6)
- Loading branch information
1 parent
5161f27
commit 197a6ff
Showing
112 changed files
with
2,436 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
Runtime/Inference/Audio/AudioClassification/AudioClassificationTask.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
Runtime/Inference/Audio/AutomaticSpeechRecognition/AutomaticSpeechRecognitionTask.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
Runtime/Inference/Audio/HuggingFace.Inference.Audio.asmdef
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
Runtime/Inference/ComputerVision/DepthEstimation/DepthEstimationResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
//using System; | ||
//using System.IO; | ||
//using System.Threading; | ||
//using System.Threading.Tasks; | ||
//using UnityEngine; | ||
//using Utilities.WebRequestRest; | ||
|
||
//namespace HuggingFace.Inference.ComputerVision.DepthEstimation | ||
//{ | ||
// public sealed class DepthEstimationResult : BinaryInferenceTaskResponse | ||
// { | ||
// public string CachedPath { get; private set; } | ||
|
||
// public Texture2D Image { get; private set; } | ||
|
||
// public override async Task DecodeAsync(Stream stream, CancellationToken cancellationToken = default) | ||
// { | ||
// await Rest.ValidateCacheDirectoryAsync(); | ||
// var filePath = Path.Combine(Rest.DownloadCacheDirectory, $"{DateTime.UtcNow:yyyy-MM-ddTHH-mm-ssffff}.jpg"); | ||
// Debug.Log(filePath); | ||
// CachedPath = filePath; | ||
// var fileStream = new FileStream(filePath, FileMode.CreateNew, FileAccess.Write, FileShare.None); | ||
|
||
// try | ||
// { | ||
// await stream.CopyToAsync(fileStream, cancellationToken); | ||
// await fileStream.FlushAsync(cancellationToken); | ||
// } | ||
// catch (Exception e) | ||
// { | ||
// Debug.LogError(e); | ||
// } | ||
// finally | ||
// { | ||
// fileStream.Close(); | ||
// await fileStream.DisposeAsync(); | ||
// } | ||
|
||
// Image = await Rest.DownloadTextureAsync($"file://{filePath}", parameters: null, cancellationToken: cancellationToken); | ||
// } | ||
// } | ||
//} |
2 changes: 1 addition & 1 deletion
2
...ication/ImageClassificationResult.cs.meta → ...hEstimation/DepthEstimationResult.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
34 changes: 20 additions & 14 deletions
34
Runtime/Inference/ComputerVision/DepthEstimation/DepthEstimationTask.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
using HuggingFace.Hub; | ||
|
||
namespace HuggingFace.Inference.ComputerVision.DepthEstimation | ||
{ | ||
public class DepthEstimationTask : InferenceTask | ||
{ | ||
public DepthEstimationTask(ModelInfo model, InferenceOptions options) | ||
: base(model, options) | ||
{ | ||
} | ||
|
||
public override string Id => "depth-estimation"; | ||
} | ||
} | ||
//// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
//using HuggingFace.Hub; | ||
//using UnityEngine.Scripting; | ||
|
||
//namespace HuggingFace.Inference.ComputerVision.DepthEstimation | ||
//{ | ||
// public sealed class DepthEstimationTask : BaseImageInferenceTask | ||
// { | ||
// [Preserve] | ||
// public DepthEstimationTask() { } | ||
|
||
// public DepthEstimationTask(SingleSourceImageInput input, ModelInfo model = null, InferenceOptions options = null) | ||
// : base(input, model, options) | ||
// { | ||
// } | ||
|
||
// public override string Id => "depth-estimation"; | ||
// } | ||
//} |
6 changes: 3 additions & 3 deletions
6
Runtime/Inference/ComputerVision/ImageClassification/ImageClassificationResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace HuggingFace.Inference.ComputerVision.ImageClassification | ||
{ | ||
public sealed class ImageClassificationResponse : JsonInferenceTaskResponse | ||
{ | ||
public ImageClassificationResponse(string content, JsonSerializerSettings settings) : base(content, settings) | ||
{ | ||
Results = JsonConvert.DeserializeObject<IReadOnlyList<ImageClassificationResult>>(content, settings); | ||
Results = JsonConvert.DeserializeObject<IReadOnlyList<ScoreResults>>(content, settings); | ||
} | ||
|
||
public IReadOnlyList<ImageClassificationResult> Results { get; } | ||
public IReadOnlyList<ScoreResults> Results { get; } | ||
} | ||
} |
23 changes: 0 additions & 23 deletions
23
Runtime/Inference/ComputerVision/ImageClassification/ImageClassificationResult.cs
This file was deleted.
Oops, something went wrong.
4 changes: 3 additions & 1 deletion
4
Runtime/Inference/ComputerVision/ImageClassification/ImageClassificationTask.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Runtime/Inference/ComputerVision/ImageSegmentation/ImageSegmentationResponse.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Runtime/Inference/ComputerVision/ImageSegmentation/ImageSegmentationResult.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
Runtime/Inference/ComputerVision/ImageSegmentation/ImageSegmentationTask.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.