quake_tensorflow_face_rec 0.0.3 copy "quake_tensorflow_face_rec: ^0.0.3" to clipboard
quake_tensorflow_face_rec: ^0.0.3 copied to clipboard

夸克tensorFlow人脸识别插件

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:quake_tensorflow_face_rec/quake_tensorflow_face_rec.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String platformVersion;
    // Platform messages may fail, so we use a try/catch PlatformException.
    // We also handle the message potentially returning null.
    try {
      platformVersion =
          await QuakeTensorflowFaceRec.platformVersion ?? 'Unknown platform version';
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child:
          Column(
            children: <Widget>[
              Text('Running on: $_platformVersion\n'),
              RaisedButton(
                child: const Text(
                  '人脸识别',
                  style: TextStyle(
                    fontSize: 28.0,
                  ),
                ),
                onPressed: () async {
                  String tf = "{\"workerFaceData\": [{\"worker_id\": \"1103\",\"tfFaceFeature\": \"[[-0.01868044,0.007812505,-0.0052591884,0.017184291,-0.0005014571,-0.04965949,0.029967971,0.15349059,-0.053747255,0.08329308,0.00912636,0.0046349885,0.011018953,-0.00039755026,-0.002642632,-0.08705466,-0.008084089,0.012478068,0.004755481,-0.009648986,0.009415537,-0.0015480589,-0.11201987,-0.00087366917,0.054474264,0.004059401,-0.0044406955,-0.0062978957,-0.024297472,-0.04813296,0.0050540534,0.12896268,0.023602508,-0.0028803032,0.04289934,0.03179192,-0.07009779,0.0077348067,0.0037648631,-0.27267113,-0.003608972,-0.0010515945,-0.010447709,0.012209092,0.000797089,0.04600996,-0.07764051,0.107896656,0.0016931049,-0.03810363,0.27371597,0.003213465,-0.079054505,0.0031518284,0.124618895,0.011195188,-0.105581164,0.0011454014,0.019570464,-0.004775963,0.019086355,0.07967502,-0.121886514,0.25350982,0.00023018163,0.10271993,-0.0023822682,-0.0027765585,0.0011481016,-0.0014262407,0.00043497843,-0.2104037,0.27965355,-0.013651227,-0.1031086,0.0007156794,-0.0031996875,0.0008730604,-0.14880206,0.014937073,0.011353092,0.014501895,-0.0065275836,0.019808568,-0.050790466,0.0036852078,0.015510053,0.24633428,0.038194813,-0.13241394,-0.050475836,0.00033103913,-0.0011533333,0.015483913,-0.21180321,-0.048339013,-0.040152818,-0.049467575,0.0005469461,-0.010648281,-0.0015942047,0.004785429,0.0023586985,0.0014409437,0.0062932107,0.0023616313,0.028117005,0.0025239778,0.010791096,-0.0055007813,-0.08203446,0.0018110019,0.010295376,0.1029968,0.001459361,-0.08075291,0.0027705778,-0.014496666,0.21282725,-0.0656544,-0.06626789,-0.020488258,-0.14761117,0.0012798345,0.0019482647,0.0062801433,0.006889822,-0.009904385,0.008737684,-0.015515512,0.0053167986,-0.00026015707,-0.00075457676,0.008163415,0.04626295,0.00022109316,-0.07476579,-0.10362371,-0.006013145,-0.009265384,0.007610806,-0.0048214523,-0.003316277,0.114775285,0.026422862,0.11494978,-0.009122699,-0.0018228391,-0.008262212,0.0028293538,0.0017020118,-0.011170498,0.19718307,-0.0047476776,0.00045479918,-0.0005824578,0.00783276,-0.014085121,-0.11133799,-0.0022158506,0.004012702,0.0027769108,0.0058411546,-0.0029568907,0.004984257,0.00824909,0.012343966,-0.07045259,0.0021965662,0.0010454953,-0.18452723,-0.044295672,0.002848347,0.008592696,-0.0068043955,-0.0056602284,-0.08085304,0.00609998,-0.004155458,0.0054296907,-0.09763085,-0.043889347,-0.0017659487,-0.003324242,-0.18701719,0.024586983,-0.08941396,0.03424759,-0.112050176,0.013452722,-0.011692863,-0.011305992]]\"},"+
                      "{\"worker_id\": \"1104\",\"tfFaceFeature\": \"[[-0.14350058138370514, 0.1078503355383873, -0.004657670855522156, -0.05975769832730293, -0.05960648134350777, -0.044779762625694275, -0.06390273571014404, -0.15250790119171143, 0.06926396489143372, -0.0564093254506588, 0.23395469784736633, -0.056720294058322906, -0.1579742580652237, -0.13758882880210876, -0.03232746571302414, 0.15290507674217224, -0.15960119664669037, -0.1065082773566246, -0.04201551526784897, -0.053293269127607346, 0.1030949056148529, 0.015350257977843285, -0.00795884057879448, 0.06006740778684616, -0.06209242343902588, -0.33922675251960754, -0.08499790728092194, -0.0663110762834549, 0.07897689193487167, -0.05105077102780342, -0.0350806899368763, -0.014884542673826218, -0.23291799426078796, -0.10737714916467667, 0.05463956668972969, 0.06962849944829941, -0.040922634303569794, -0.05898190289735794, 0.1496339738368988, -0.03293885290622711, -0.17047880589962006, 0.037061236798763275, 0.12307049334049225, 0.25998181104660034, 0.20632529258728027, 0.06892731785774231, 0.0026313508860766888, -0.12765298783779144, 0.09250334650278091, -0.11931072175502777, 0.028396714478731155, 0.13562560081481934, 0.09461446106433868, 0.0778050646185875, 0.014100543223321438, -0.12716440856456757, 0.04378762096166611, 0.09837730973958969, -0.1735524833202362, 0.025433026254177094, 0.08220037072896957, -0.07226114720106125, -0.028256069868803024, -0.0753258466720581, 0.252644419670105, 0.029939331114292145, -0.131501242518425, -0.16636553406715393, 0.13564994931221008, -0.10314525663852692, -0.04550720378756523, 0.03973875567317009, -0.14315281808376312, -0.19514954090118408, -0.2825012505054474, 0.09841077774763107, 0.36831510066986084, 0.13358213007450104, -0.1700563281774521, 0.07984152436256409, -0.038504358381032944, -0.00814746879041195, 0.14558936655521393, 0.1374904364347458, 0.0144827701151371, -0.03113263100385666, -0.040294960141181946, 0.030583824962377548, 0.17230921983718872, -0.02575289085507393, -0.03858082741498947, 0.18884003162384033, -0.034976713359355927, 0.0429825596511364, 0.014559542760252953, 0.06637340784072876, -0.1126251220703125, 0.07733730971813202, -0.11530797928571701, -0.0016036145389080048, 0.049398552626371384, -0.030105149373412132, 0.05625452101230621, 0.14135140180587769, -0.11795134097337723, 0.12083422392606735, 0.011886876076459885, 0.044985320419073105, 0.01627098023891449, -0.015591993927955627, -0.08176986128091812, -0.06218818947672844, 0.06294252723455429, -0.23972930014133453, 0.2850410044193268, 0.17688386142253876, 0.07630788534879684, 0.12514379620552063, 0.12403734773397446, 0.06877363473176956, 0.058838363736867905, -0.00432233139872551, -0.20031693577766418, -0.027797004207968712, 0.08945595473051071, -0.046497054398059845, 0.09633969515562057, 0.0018555708229541779], [-0.10489009320735931, 0.024258393794298172, 0.02048499695956707, -0.1047137975692749, -0.05106231942772865, -0.038390111178159714, -0.06483391672372818, -0.13122066855430603, 0.06734957545995712, -0.10047248005867004, 0.2585979998111725, -0.09823185205459595, -0.1651199758052826, -0.1364780068397522, -0.06366196274757385, 0.18091830611228943, -0.2082003951072693, -0.09032437205314636, -0.031958386301994324, -0.014117840677499771, 0.07247021794319153, -0.022005215287208557, -0.030097631737589836, 0.05425079166889191, -0.06271842122077942, -0.33510294556617737, -0.10604360699653625, -0.047899164259433746, 0.08858820796012878, -0.05322257801890373, -0.026329029351472855, 0.01863190159201622, -0.2253163903951645, -0.0677979588508606, 0.007705039344727993, 0.039014868438243866, -0.01878911815583706, -0.08643721789121628, 0.15794715285301208, -0.027613762766122818, -0.17520679533481598, 0.016485091298818588, 0.09331154823303223, 0.2406175434589386, 0.1813526749610901, 0.07017835229635239, 0.005888381972908974, -0.13326430320739746, 0.14136484265327454, -0.1795014590024948, 0.0020530298352241516, 0.10086928308010101, 0.07464559376239777, 0.03926091641187668, -0.021674595773220062, -0.11623752117156982, 0.059522680938243866, 0.15787304937839508, -0.18920807540416718, 0.057785764336586, 0.07040757685899734, -0.08033572137355804, -0.020416123792529106, -0.08249659091234207, 0.2518391013145447, 0.06846053898334503, -0.12471362203359604, -0.1558140218257904, 0.18414564430713654, -0.09796682000160217, -0.029267869889736176, 0.013941369950771332, -0.11373744159936905, -0.17815794050693512, -0.3004700839519501, 0.024978842586278915, 0.3693740665912628, 0.14489410817623138, -0.1845758855342865, 0.0701223686337471, -0.05790204554796219, 0.011891720816493034, 0.18518903851509094, 0.1297311782836914, -0.02105475589632988, -0.01778039149940014, -0.08188003301620483, 0.002163487486541271, 0.19148144125938416, -0.0171947218477726, -0.004369752481579781, 0.20504894852638245, -0.0158033836632967, 0.0605030357837677, 0.020161237567663193, 0.02387484908103943, -0.12655241787433624, 0.051032137125730515, -0.1373526155948639, -0.013528057374060154, 0.045559197664260864, -0.0005161762237548828, 0.06643591821193695, 0.16078653931617737, -0.09673946350812912, 0.16894753277301788, 0.007386249490082264, 0.050817351788282394, 0.049852486699819565, -0.017508557066321373, -0.036603618413209915, -0.05669281259179115, 0.06884144246578217, -0.1980012208223343, 0.18932807445526123, 0.14060503244400024, 0.10272780060768127, 0.1275634467601776, 0.13898590207099915, 0.0905223935842514, -0.011560001410543919, -0.023254062980413437, -0.24124467372894287, 0.0022444818168878555, 0.09488322585821152, -0.06175384297966957, 0.12961530685424805, -0.0003334418870508671]]\"}]}";
                  String? message =
                  await QuakeTensorflowFaceRec.jumpToFaceRec("SignIn",tf);
                  // ignore: avoid_print
                  print("Dart层:" + message!);
                },
              ),
            ],
          ),

        ),
      ),
    );
  }
}
0
likes
110
pub points
0%
popularity

Publisher

unverified uploader

夸克tensorFlow人脸识别插件

Homepage

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on quake_tensorflow_face_rec