René's URL Explorer Experiment


Title: my flutter sign language detector is not detecting anything · Issue #554 · OpenSourceHelpCommunity/Questions · GitHub

Open Graph Title: my flutter sign language detector is not detecting anything · Issue #554 · OpenSourceHelpCommunity/Questions

X Title: my flutter sign language detector is not detecting anything · Issue #554 · OpenSourceHelpCommunity/Questions

Description: i am using SSDMOBILENETV2 FPN LITE 320x32 pretrained model and i trained it with my custom sign language datasets. here is my object_detection_service.dart `import 'package:camera/camera.dart'; import 'package:tflite_flutter/tflite_flutt...

Open Graph Description: i am using SSDMOBILENETV2 FPN LITE 320x32 pretrained model and i trained it with my custom sign language datasets. here is my object_detection_service.dart `import 'package:camera/camera.dart'; imp...

X Description: i am using SSDMOBILENETV2 FPN LITE 320x32 pretrained model and i trained it with my custom sign language datasets. here is my object_detection_service.dart `import 'package:camera/camera.dart&#...

Opengraph URL: https://github.com/OpenSourceHelpCommunity/Questions/issues/554

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"my flutter sign language detector is not detecting anything","articleBody":"i am using SSDMOBILENETV2 FPN LITE 320x32 pretrained model and i trained it with my custom sign language datasets.\n\nhere is my object_detection_service.dart\n`import 'package:camera/camera.dart';\nimport 'package:tflite_flutter/tflite_flutter.dart';\nimport 'package:image/image.dart' as img;\nimport 'dart:developer' as dev;\n\nclass InferenceData {\n  final Interpreter interpreter;\n  final List\u003cList\u003cList\u003cList\u003cdouble>>>> inputData;\n\n  InferenceData(this.interpreter, this.inputData);\n}\n\nclass InferenceResult {\n  final List\u003cdouble> scores;\n  final List\u003cList\u003cdouble>> boxes;\n  final List\u003cdouble> classes;\n\n  InferenceResult(this.scores, this.boxes, this.classes);\n}\n\nclass ObjectDetectionService {\n  static const int inputSize = 320;\n  static const double confidenceThreshold = 0.1;\n\n  static void _log(String message) {\n    dev.log('[ObjectDetection] $message');\n  }\n\n  static Future\u003cList\u003cList\u003cList\u003cList\u003cdouble>>>>> preprocessImageIsolate(CameraImage image) async {\n    try {\n      final img.Image rgbImage;\n      if (image.format.group == ImageFormatGroup.yuv420) {\n        rgbImage = _convertYUV420(image);\n      } else if (image.format.group == ImageFormatGroup.bgra8888) {\n        rgbImage = _convertBGRA8888(image);\n      } else {\n        throw Exception('Unsupported image format: ${image.format.group}');\n      }\n\n      final resized = img.copyResize(\n        rgbImage,\n        width: inputSize,\n        height: inputSize,\n        interpolation: img.Interpolation.linear,\n      );\n\n      final input = List.generate(\n        1,\n        (index) => List.generate(\n          inputSize,\n          (y) => List.generate(\n            inputSize,\n            (x) => List.generate(\n              3,\n              (c) {\n                final pixel = resized.getPixel(x, y);\n                // Normalize to [0, 1] instead of [-1, 1]\n                return c == 0\n                    ? pixel.r / 255.0\n                    : c == 1\n                        ? pixel.g / 255.0\n                        : pixel.b / 255.0;\n              },\n            ),\n          ),\n        ),\n      );\n\n      _log('Image preprocessed');\n      return input;\n    } catch (e, stack) {\n      _log('Preprocessing error: $e\\n$stack');\n      throw Exception('Preprocessing failed: $e');\n    }\n  }\n\n  static img.Image _convertYUV420(CameraImage image) {\n    final width = image.width;\n    final height = image.height;\n    final yPlane = image.planes[0].bytes;\n    final uPlane = image.planes[1].bytes;\n    final vPlane = image.planes[2].bytes;\n\n    final yRowStride = image.planes[0].bytesPerRow;\n    final uvRowStride = image.planes[1].bytesPerRow;\n    final uvPixelStride = image.planes[1].bytesPerPixel!;\n\n    final output = img.Image(width: width, height: height);\n\n    for (int y = 0; y \u003c height; y++) {\n      for (int x = 0; x \u003c width; x++) {\n        final int yIndex = y * yRowStride + x;\n        final int uvIndex = (y ~/ 2) * uvRowStride + (x ~/ 2) * uvPixelStride;\n\n        final yValue = yPlane[yIndex];\n        final uValue = uPlane[uvIndex];\n        final vValue = vPlane[uvIndex];\n\n        // Using standard YUV to RGB conversion\n        final int r = (yValue + (1.370705 * (vValue - 128))).toInt().clamp(0, 255);\n        final int g = (yValue - (0.698001 * (vValue - 128)) - (0.337633 * (uValue - 128))).toInt().clamp(0, 255);\n        final int b = (yValue + (1.732446 * (uValue - 128))).toInt().clamp(0, 255);\n\n        output.setPixelRgb(x, y, r, g, b);\n      }\n    }\n\n    return output;\n  }\n\n  static img.Image _convertBGRA8888(CameraImage image) {\n    return img.Image.fromBytes(\n      width: image.width,\n      height: image.height,\n      bytes: image.planes[0].bytes.buffer,\n      order: img.ChannelOrder.bgra,\n    );\n  }\n\n  static Future\u003cInferenceResult?> runInferenceIsolate(InferenceData data) async {\n    try {\n      final outputBoxes = List\u003cList\u003cdouble>>.generate(\n        100,\n        (_) => List\u003cdouble>.filled(4, 0.0),\n      );\n      final outputClasses = List\u003cdouble>.filled(100, 0);\n      final outputScores = List\u003cdouble>.filled(100, 0);\n      final outputCount = [1.0];\n\n      final outputs = {\n        0: outputScores,\n        1: outputBoxes,\n        2: outputCount,\n        3: outputClasses,\n      };\n\n      data.interpreter.runForMultipleInputs([data.inputData], outputs);\n\n      // Debug logging\n      _log('Scores: ${outputScores.take(5).toList()}');\n      _log('Classes: ${outputClasses.take(5).toList()}');\n      _log('First box: ${outputBoxes[0]}');\n\n      return InferenceResult(\n        outputScores,\n        outputBoxes,\n        outputClasses,\n      );\n    } catch (e, stack) {\n      _log('Inference error: $e\\n$stack');\n      return null;\n    }\n  }\n}\n\n\n`\n\nand my scan_controller.dart: \n`import 'dart:developer' as dev;\nimport 'package:camera/camera.dart';\nimport 'package:get/get.dart';\nimport 'package:tflite_flutter/tflite_flutter.dart';\nimport 'package:flutter/services.dart';\nimport 'package:flutter/foundation.dart';\nimport 'camera_service.dart';\nimport 'object_detection_service.dart';\n\nclass ScanController extends GetxController {\n  final List\u003cCameraDescription> cameras;\n  late CameraService cameraService;\n  late ObjectDetectionService detectionService;\n  Interpreter? interpreter;\n  List\u003cString> labels = [];\n\n  RxBool isCameraInitialized = false.obs;\n  RxString errorMessage = ''.obs;\n  RxString label = ''.obs;\n  RxDouble x = 0.0.obs;\n  RxDouble y = 0.0.obs;\n  RxDouble w = 0.0.obs;\n  RxDouble h = 0.0.obs;\n  RxBool isProcessing = false.obs;\n  RxBool isTabActive = true.obs;\n\n  static const String modelPath = 'assets/model.tflite';\n  static const String labelsPath = 'assets/labels.txt';\n  static const Duration _processingInterval = Duration(milliseconds: 100);\n  DateTime _lastProcessingTime = DateTime.now();\n\n  ScanController({required this.cameras}) {\n    cameraService = CameraService(cameras: cameras);\n    detectionService = ObjectDetectionService();\n  }\n\n  void _log(String message) {\n    dev.log('[ScanController] $message');\n  }\n\n  @override\n  void onInit() {\n    super.onInit();\n    _initialize();\n  }\n\n  @override\n  void onClose() {\n    disposeResources();\n    super.onClose();\n  }\n\n  Future\u003cvoid> _initialize() async {\n    try {\n      _log('Starting initialization');\n      \n      final options = InterpreterOptions()..threads = 4;\n      \n      interpreter = await Interpreter.fromAsset(\n        modelPath,\n        options: options,\n      );\n\n      // Log interpreter details\n      final inputTensor = interpreter!.getInputTensor(0);\n      final outputTensor = interpreter!.getOutputTensor(0);\n      _log('Input tensor shape: ${inputTensor.shape}');\n      _log('Output tensor shape: ${outputTensor.shape}');\n\n      await loadLabels();\n      await initializeCamera();\n      _log('Initialization complete');\n    } catch (e, stack) {\n      errorMessage.value = 'Initialization error: $e';\n      _log('Initialization error: $e\\n$stack');\n    }\n  }\n\n  Future\u003cvoid> loadLabels() async {\n    try {\n      final labelData = await rootBundle.loadString(labelsPath);\n      labels = labelData.split('\\n')\n          .where((label) => label.trim().isNotEmpty)\n          .toList();\n      _log('Labels loaded: ${labels.length}');\n      _log('First 5 labels: ${labels.take(5).toList()}');\n    } catch (e) {\n      _log('Error loading labels: $e');\n      rethrow;\n    }\n  }\n\n  Future\u003cvoid> initializeCamera() async {\n    try {\n      await cameraService.initialize();\n      if (isTabActive.value) {\n        await startCamera();\n      }\n      isCameraInitialized.value = true;\n    } catch (e) {\n      errorMessage.value = e.toString();\n      _log('Camera initialization error: $e');\n      rethrow;\n    }\n  }\n\n  Future\u003cvoid> startCamera() async {\n    if (!isCameraInitialized.value) return;\n    await cameraService.startImageStream(_processCameraImage);\n  }\n\n  Future\u003cvoid> stopCamera() async {\n    await cameraService.stopImageStream();\n  }\n\n  Future\u003cvoid> disposeResources() async {\n    try {\n      await cameraService.dispose();\n      interpreter?.close();\n      isProcessing.value = false;\n      isCameraInitialized.value = false;\n    } catch (e) {\n      _log('Error during resource disposal: $e');\n    }\n  }\n\n  Future\u003cvoid> _processCameraImage(CameraImage image) async {\n    if (isProcessing.value) return;\n\n    final now = DateTime.now();\n    if (now.difference(_lastProcessingTime) \u003c _processingInterval) return;\n    \n    _lastProcessingTime = now;\n    isProcessing.value = true;\n\n    try {\n      if (interpreter == null) {\n        _log('Interpreter not ready');\n        return;\n      }\n\n      final inputData = await compute(\n        ObjectDetectionService.preprocessImageIsolate,\n        image,\n      );\n      _log('Image preprocessed');\n\n      final outputs = await compute(\n        ObjectDetectionService.runInferenceIsolate,\n        InferenceData(interpreter!, inputData),\n      );\n      _log('Inference run completed');\n\n      if (outputs != null) {\n        _processDetections(\n          outputs.scores,\n          outputs.boxes,\n          outputs.classes,\n        );\n      }\n    } catch (e, stack) {\n      _log('Processing error: $e\\n$stack');\n    } finally {\n      isProcessing.value = false;\n    }\n  }\n\n  void _processDetections(\n    List\u003cdouble> scores,\n    List\u003cList\u003cdouble>> boxes,\n    List\u003cdouble> classes,\n  ) {\n    try {\n      double maxScore = 0;\n      int maxIndex = -1;\n\n      _log('Processing detections:');\n      _log('Scores: ${scores.take(5)}');\n      _log('Classes: ${classes.take(5)}');\n\n      for (var i = 0; i \u003c scores.length; i++) {\n        if (scores[i] > maxScore && \n            scores[i] > ObjectDetectionService.confidenceThreshold) {\n          maxScore = scores[i];\n          maxIndex = i;\n        }\n      }\n\n      if (maxIndex != -1) {\n        final box = boxes[maxIndex];\n        final classIndex = classes[maxIndex].toInt();\n        if (classIndex \u003c labels.length) {\n          label.value = '${labels[classIndex]} ${(maxScore * 100).toStringAsFixed(0)}%';\n          y.value = box[0];\n          x.value = box[1];\n          h.value = box[2] - box[0];\n          w.value = box[3] - box[1];\n          _log('Detection: ${label.value} at ($x, $y) with size ($w, $h)');\n        }\n      } else {\n        label.value = '';\n      }\n    } catch (e, stack) {\n      _log('Detection processing error: $e\\n$stack');\n    }\n  }\n}`\n\ni have been working on this for weeks now and i dont know what else to do, i am also new to programming.","author":{"url":"https://github.com/janrabang","@type":"Person","name":"janrabang"},"datePublished":"2025-02-13T03:37:48Z","url":"https://github.com/OpenSourceHelpCommunity/Questions/issues/554"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5ded06bd-9b33-a895-caa6-e865a3899c1a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD700:3A347:DB3F15:123B53A:6B00FE19
html-safe-nonce7436f77e462235a71c0d51bcab2a7fd4e1f0b93d1d6dd4491859f001ec3a5c1b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzAwOjNBMzQ3OkRCM0YxNToxMjNCNTNBOjZCMDBGRTE5IiwidmlzaXRvcl9pZCI6IjU0MTQ5NDg5ODg4MTIwNjYzMjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac105759f9a014f0cf3530753ea8d35ff56e38ef6f27471458af6acebfc3f95e71
hovercard-subject-tagissue:2849862490
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/OpenSourceHelpCommunity/Questions/554/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0c79da0de7b8c514f5148a08ecac2c8afed5e1c762abfa7f4dec01eb7f077fd7/OpenSourceHelpCommunity/Questions/issues/554
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0c79da0de7b8c514f5148a08ecac2c8afed5e1c762abfa7f4dec01eb7f077fd7/OpenSourceHelpCommunity/Questions/issues/554
og:image:alti am using SSDMOBILENETV2 FPN LITE 320x32 pretrained model and i trained it with my custom sign language datasets. here is my object_detection_service.dart `import 'package:camera/camera.dart'; imp...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejanrabang
hostnamegithub.com
expected-hostnamegithub.com
Nonee208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187
turbo-cache-controlno-preview
go-importgithub.com/OpenSourceHelpCommunity/Questions git https://github.com/OpenSourceHelpCommunity/Questions.git
octolytics-dimension-user_id23719480
octolytics-dimension-user_loginOpenSourceHelpCommunity
octolytics-dimension-repository_id78395582
octolytics-dimension-repository_nwoOpenSourceHelpCommunity/Questions
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id78395582
octolytics-dimension-repository_network_root_nwoOpenSourceHelpCommunity/Questions
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7dafd017fb7809a839c443dba08622af38e63c09
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/OpenSourceHelpCommunity/Questions/issues/554#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FOpenSourceHelpCommunity%2FQuestions%2Fissues%2F554
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FOpenSourceHelpCommunity%2FQuestions%2Fissues%2F554
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=OpenSourceHelpCommunity%2FQuestions
Reloadhttps://github.com/OpenSourceHelpCommunity/Questions/issues/554
Reloadhttps://github.com/OpenSourceHelpCommunity/Questions/issues/554
Reloadhttps://github.com/OpenSourceHelpCommunity/Questions/issues/554
OpenSourceHelpCommunityhttps://github.com/OpenSourceHelpCommunity
Questionshttps://github.com/OpenSourceHelpCommunity/Questions
Codehttps://github.com/OpenSourceHelpCommunity/Questions
Issues479 (479)https://github.com/OpenSourceHelpCommunity/Questions/issues
Pull requests5 (5)https://github.com/OpenSourceHelpCommunity/Questions/pulls
Actionshttps://github.com/OpenSourceHelpCommunity/Questions/actions
Projectshttps://github.com/OpenSourceHelpCommunity/Questions/projects
Security and qualityhttps://github.com/OpenSourceHelpCommunity/Questions/security
Insightshttps://github.com/OpenSourceHelpCommunity/Questions/insights
https://github.com/OpenSourceHelpCommunity/Questions
New issuehttps://github.com/login?return_to=https://github.com/OpenSourceHelpCommunity/Questions/issues/554
New issuehttps://github.com/login?return_to=https://github.com/OpenSourceHelpCommunity/Questions/issues/554
my flutter sign language detector is not detecting anythinghttps://github.com/OpenSourceHelpCommunity/Questions/issues/554#top
https://github.com/janrabang
janrabanghttps://github.com/janrabang
on Feb 13, 2025https://github.com/OpenSourceHelpCommunity/Questions/issues/554#issue-2849862490
@OverRidehttps://github.com/OverRide
@OverRidehttps://github.com/OverRide
Sign up for freehttps://github.com/signup?return_to=https://github.com/OpenSourceHelpCommunity/Questions/issues/554
Sign in to commenthttps://github.com/login?return_to=https://github.com/OpenSourceHelpCommunity/Questions/issues/554
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.