{"id":15050695,"url":"https://github.com/silkodenis/metal-tflite-interpreter","last_synced_at":"2026-01-02T07:07:11.551Z","repository":{"id":238121733,"uuid":"795887595","full_name":"silkodenis/metal-tflite-interpreter","owner":"silkodenis","description":"Interpreter designed to run TensorFlow Lite models using Metal for real-time GPU processing.","archived":false,"fork":false,"pushed_at":"2024-05-04T11:10:31.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T21:49:57.406Z","etag":null,"topics":["computer-vision","gpu","interpreter","ios","macos","metal","ml","objective-c","processing","tensorflow","tflite"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/silkodenis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-04T10:56:09.000Z","updated_at":"2024-05-04T11:23:49.000Z","dependencies_parsed_at":"2024-05-04T13:43:59.776Z","dependency_job_id":null,"html_url":"https://github.com/silkodenis/metal-tflite-interpreter","commit_stats":null,"previous_names":["silkodenis/metal-tflite-interpreter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silkodenis%2Fmetal-tflite-interpreter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silkodenis%2Fmetal-tflite-interpreter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silkodenis%2Fmetal-tflite-interpreter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silkodenis%2Fmetal-tflite-interpreter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silkodenis","download_url":"https://codeload.github.com/silkodenis/metal-tflite-interpreter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243511176,"owners_count":20302516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","gpu","interpreter","ios","macos","metal","ml","objective-c","processing","tensorflow","tflite"],"created_at":"2024-09-24T21:28:56.688Z","updated_at":"2026-01-02T07:07:11.524Z","avatar_url":"https://github.com/silkodenis.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Metal Tensorflow Lite Interpreter\n\n`MetalTFLiteInterpreter` is an Objective-C class designed to run TensorFlow Lite models using Metal for accelerated GPU execution.\n\n## Key Features\n- **TensorFlow Lite Support:** Allows using models exported in TensorFlow Lite.\n- **Hardware Acceleration:** Uses the Metal delegate to execute the model on a GPU.\n- **Easy Integration:** Effortlessly binds input and output buffers.\n\n## Requirements\n- Xcode 12.5+ (to support Metal)\n- TensorFlow Lite C API\n- macOS or iOS with Metal support\n\n## Installation\n1. **CocoaPods (Recommended):** Add the TensorFlow Lite C API to your project via CocoaPods. In the `Podfile`, add the following configuration:\n\n    ```ruby\n    pod 'TensorFlowLiteC', :subspecs =\u003e ['Metal']\n    ```\n\n    Then, run:\n\n    ```bash\n    pod install\n    ```\n\n2. **Cloning:** Clone the repository with the code or copy the necessary files to your project.\n\n3. **Dependency Configuration:** Make sure that TensorFlow Lite and TensorFlowLiteCMetal are correctly added to your project.\n\n## Usage\n1. **Initialization:**\nCreate an instance of `MetalTFLiteInterpreter`, specifying the path to your model:\n\n```objc\nNSString *modelPath = @\"path/to/your/model.tflite\";\nMetalTFLiteInterpreter *interpreter = [[MetalTFLiteInterpreter alloc] initWithFilePath:modelPath];\n```\n\n2. **Buffer Binding:**\nBind an MTLBuffer to an input or output tensor by specifying the index:\n\n```objc\nBOOL success = [interpreter bindMetalBuffer:yourMTLBuffer toTensor:INPUT index:0];\nif (!success) {\n    NSLog(@\"Failed to bind Metal buffer.\");\n}\n```\n\n3. **Invoke Model:**\nCall invoke to execute the model:\n\n```objc\nBOOL invocationSuccess = [interpreter invoke];\nif (!invocationSuccess) {\n    NSLog(@\"Failed to invoke interpreter.\");\n}\n```\n\n4. **Access Results:**\nAccess results through the output buffer:\n\n```objc\nvoid *outputBuffer = [interpreter bufferPointerForOutputTensor:0];\nsize_t outputSize = [interpreter bufferSizeForOutputTensor:0];\n```\n\n## License\nThis project is licensed under the [Apache License, Version 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilkodenis%2Fmetal-tflite-interpreter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilkodenis%2Fmetal-tflite-interpreter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilkodenis%2Fmetal-tflite-interpreter/lists"}