react-native-yolo 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,8 +32,8 @@ public class HybridYoloModel: HybridYoloModelSpec {
32
32
 
33
33
  try localInterpreter.allocateTensors()
34
34
 
35
- let inputTensor = try localInterpreter.inputTensor(at: 0)
36
- let outputTensor = try localInterpreter.outputTensor(at: 0)
35
+ let inputTensor = try localInterpreter.input(at: 0)
36
+ let outputTensor = try localInterpreter.output(at: 0)
37
37
 
38
38
  let shape = inputTensor.shape.dimensions
39
39
 
@@ -81,7 +81,7 @@ public class HybridYoloModel: HybridYoloModelSpec {
81
81
  try localInterpreter.invoke()
82
82
 
83
83
  // Récupération des résultats du tenseur de sortie
84
- let outputTensor = try localInterpreter.outputTensor(at: 0)
84
+ let outputTensor = try localInterpreter.output(at: 0)
85
85
 
86
86
  // Extraction et conversion de la structure des tenseurs [1, 300, 6] en Float
87
87
  let nativeOutputs = outputTensor.data.withUnsafeBytes { (ptr: UnsafeRawBufferPointer) -> [Float] in
@@ -104,7 +104,7 @@ public class YoloModelLoader {
104
104
  */
105
105
  public func makeInputBuffer(interpreter: Interpreter) throws -> Data {
106
106
  // Récupérer le premier tenseur d'entrée du modèle TFLite
107
- let inputTensor = try interpreter.inputTensor(at: 0)
107
+ let inputTensor = try interpreter.input(at: 0)
108
108
  let shape = inputTensor.shape.dimensions // Généralement: [1, 640, 640, 3]
109
109
  let dataType = inputTensor.dataType
110
110
 
@@ -8,7 +8,9 @@ public enum Yuv420ToNv12Converter {
8
8
  public static func convert(frame: any HybridFrameSpec, width: Int, height: Int) -> [UInt8] {
9
9
  do {
10
10
  let nativeBuffer = try frame.getNativeBuffer()
11
- guard let rawPointer = nativeBuffer.pointer else { return [] }
11
+ guard let rawPointer = UnsafeRawPointer(bitPattern: UInt(nativeBuffer.pointer)) else {
12
+ return []
13
+ }
12
14
 
13
15
  let pixelBuffer = Unmanaged<CVPixelBuffer>
14
16
  .fromOpaque(rawPointer)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-yolo",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "react-native-yolo is a react native package built with Nitro",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/module/index.js",