diff --git a/tfjs-react-native/integration_rn59/components/tfjs_unit_test_runner.tsx b/tfjs-react-native/integration_rn59/components/tfjs_unit_test_runner.tsx index 27a1f78c502..9e8b1f2653c 100644 --- a/tfjs-react-native/integration_rn59/components/tfjs_unit_test_runner.tsx +++ b/tfjs-react-native/integration_rn59/components/tfjs_unit_test_runner.tsx @@ -106,6 +106,11 @@ export class TestRunner extends Component { // Browser specific mobile test return false; } + + if(name.match('dilation2d')) { + // Not implemented in webgl + return false; + } return true; } }); diff --git a/tfjs-react-native/integration_rn59/package.json b/tfjs-react-native/integration_rn59/package.json index 8771892ae4a..430d0fd160a 100644 --- a/tfjs-react-native/integration_rn59/package.json +++ b/tfjs-react-native/integration_rn59/package.json @@ -21,7 +21,7 @@ "@tensorflow-models/blazeface": "^0.0.2", "@tensorflow-models/mobilenet": "^2.0.4", "@tensorflow-models/posenet": "^2.2.1", - "@tensorflow/tfjs": "2.0.0", + "@tensorflow/tfjs": "2.6.0", "@tensorflow/tfjs-react-native": "0.3.0", "expo-camera": "^7.0.0", "expo-gl": "^7.0.0", diff --git a/tfjs-react-native/integration_rn59/yarn.lock b/tfjs-react-native/integration_rn59/yarn.lock index 9ee4c52c2f1..0053f106755 100644 --- a/tfjs-react-native/integration_rn59/yarn.lock +++ b/tfjs-react-native/integration_rn59/yarn.lock @@ -863,55 +863,55 @@ resolved "https://registry.yarnpkg.com/@tensorflow-models/posenet/-/posenet-2.2.1.tgz#2f0a68d909842f59eec195f23c6f3d4cebc53fa8" integrity sha512-n9/g6DfjAyrBTf/zt1haRCyWsgALxUCzg9/Ks3Y2mbYavRZVSCSTRPy/qlE5Hr4tLfyckGfDN14zmGTthNcg/g== -"@tensorflow/tfjs-backend-cpu@2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-2.0.0.tgz#26d3ed8a6d814e751adc22e6036e40ed8940b5ac" - integrity sha512-eYj8CBjL8v2gHaYdS7JN1swi9kQYOHenMYBkf4khhW83ViZwpPmISyYzun8fy2gBlv28Y7juMmXHSncSDWfI1Q== +"@tensorflow/tfjs-backend-cpu@2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-2.6.0.tgz#bd0923ca438e945c4c9347a76e301a4fb1890d33" + integrity sha512-essk82VoET77tuFX5Sa9zv9F8d/2DxjEQ2RavoU+ugs0l64DTbdTpv3WdQwUihv1gNN7/16fUjJ6cG80SnS8/g== dependencies: "@types/seedrandom" "2.4.27" seedrandom "2.4.3" -"@tensorflow/tfjs-backend-webgl@2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-backend-webgl/-/tfjs-backend-webgl-2.0.0.tgz#8f53ca3598ff922ee6ad28daf0ccc8089981d105" - integrity sha512-Y76LYbq8Z0Nquh2Fk+ToxhbjmLxBGX7vBLeGXi1TwvWJOBgfqroFNk2R6vspaZNd4wKfUMM+CWayPFUHcLCsWg== +"@tensorflow/tfjs-backend-webgl@2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-backend-webgl/-/tfjs-backend-webgl-2.6.0.tgz#3855c254a86daf28511530c36bb61938acf26740" + integrity sha512-j1eNYKIpO06CTSRXiIWdpZ2iPDBkx7PPl7K/1BtCEW/9FP7Q0q3doHKNmTdOPvuw7Dt1nNHEMnba0YB2lc5S7Q== dependencies: - "@tensorflow/tfjs-backend-cpu" "2.0.0" + "@tensorflow/tfjs-backend-cpu" "2.6.0" "@types/offscreencanvas" "~2019.3.0" "@types/seedrandom" "2.4.27" "@types/webgl-ext" "0.0.30" "@types/webgl2" "0.0.4" seedrandom "2.4.3" -"@tensorflow/tfjs-converter@2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-converter/-/tfjs-converter-2.0.0.tgz#6242c618202f04d88fa308d68a2dfcdd81ec020c" - integrity sha512-IFjjx2qe7M2UwwYJvCm2+OgpC+kooCWEjC8mOOoFV/o+g9/Q0RMohRDvffiqUuYx5Usi/vbjhlUBccsy/MhE3g== +"@tensorflow/tfjs-converter@2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-converter/-/tfjs-converter-2.6.0.tgz#0de5c4c014c25d695ad17ca19e3b654dbcb84cea" + integrity sha512-TzL4ULidZ26iVqfLmv5G6dfnJyJt5HttU1VZoBYCbxUcWQYk1Z4D9wqLVwfdcJz01XEKpmsECh8HBF0hwYlrkA== -"@tensorflow/tfjs-core@2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-core/-/tfjs-core-2.0.0.tgz#c18e963d0332255dc37d6ff58fa0076402ae00d0" - integrity sha512-GB02Lyjp7NLKbjCOW6S3Vx2CkkUwtJFt8fY7Zaoyy/ANB4Iw8eiHJV0308CClrFfjA+UKU3TrO+bOQfeCJaEUw== +"@tensorflow/tfjs-core@2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-core/-/tfjs-core-2.6.0.tgz#ab2f2c9e8f46990643076d7d5bdb912885282bd2" + integrity sha512-akUB1iz663UCUdOfEUu91XeHzGpdYtdtMPxjsGEdF0CwENzSAcvHzQrEVoPBRD+RKpxrVXvQBoOd7GYBxMIIKQ== dependencies: "@types/offscreencanvas" "~2019.3.0" "@types/seedrandom" "2.4.27" "@types/webgl-ext" "0.0.30" "@types/webgl2" "0.0.4" - node-fetch "~2.1.2" + node-fetch "~2.6.1" seedrandom "2.4.3" -"@tensorflow/tfjs-data@2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-data/-/tfjs-data-2.0.0.tgz#1bc7ac2fea26f40fa0fc9f4c2225ea262dd9bc7c" - integrity sha512-anr2udw2FPsX7oZwEuHYk5iaJQlxIe8EmTePYCNb80o77rZ+0Yu7RoOIUipjrW5zIh6OdkjfvGvg0tdZ35jiIA== +"@tensorflow/tfjs-data@2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-data/-/tfjs-data-2.6.0.tgz#005fb204822322bc652ddd968c15a6b1a295652a" + integrity sha512-/x/j/A4Quiyc21xEYyBC82mqyssbFHRuHez7pYVJA/28TOesAfWPWo2I+wkeOTt91UerUeZMSq2FV3HOnPInhQ== dependencies: "@types/node-fetch" "^2.1.2" - node-fetch "~2.1.2" + node-fetch "~2.6.1" -"@tensorflow/tfjs-layers@2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-layers/-/tfjs-layers-2.0.0.tgz#cdd2aa013350d88091e2e840a298a272356cb4e3" - integrity sha512-3jcXVDVbHvkDOSXbvtOgxB1WfRc1asNKOrnNrSfsQhB590DkCUH0QzKSInCe3GyoFhbUZhUwIDz0aFW+GdGgeQ== +"@tensorflow/tfjs-layers@2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-layers/-/tfjs-layers-2.6.0.tgz#fed57ff6514f3fbb78fbcd2d40a09e9bd8d52cfc" + integrity sha512-nU9WNSGpEU6GzKo5bvJBMa/OZRe1bR5Z2W6T0XiEY8CBiPNS+oJFJNm0NY8kQj/WnDS0Hfue38P46q7gV/9XMA== "@tensorflow/tfjs-react-native@0.3.0": version "0.3.0" @@ -922,19 +922,22 @@ buffer "^5.2.1" jpeg-js "^0.3.6" -"@tensorflow/tfjs@2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@tensorflow/tfjs/-/tfjs-2.0.0.tgz#7c014dd91648ab8c95cdc4261b163402493b60f5" - integrity sha512-+c3llrY54NgMBXJnhTkDS5t0us/zHynwuDQiVcMfjD9pBDa3fC7RLcpLrYl/cFGAdhH8XdjcjvqFjWze7S5IcQ== - dependencies: - "@tensorflow/tfjs-backend-cpu" "2.0.0" - "@tensorflow/tfjs-backend-webgl" "2.0.0" - "@tensorflow/tfjs-converter" "2.0.0" - "@tensorflow/tfjs-core" "2.0.0" - "@tensorflow/tfjs-data" "2.0.0" - "@tensorflow/tfjs-layers" "2.0.0" +"@tensorflow/tfjs@2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@tensorflow/tfjs/-/tfjs-2.6.0.tgz#ddc420fbb0d9561f46d3d02ba3ba2d4c15861837" + integrity sha512-f70NAt480+/NH6ueAdKhwgN3BzeBWrvuAZ591pH44nuVlmUHtih7pSMVv2wREPOgA4ciAufops4FtTaqNamxZw== + dependencies: + "@tensorflow/tfjs-backend-cpu" "2.6.0" + "@tensorflow/tfjs-backend-webgl" "2.6.0" + "@tensorflow/tfjs-converter" "2.6.0" + "@tensorflow/tfjs-core" "2.6.0" + "@tensorflow/tfjs-data" "2.6.0" + "@tensorflow/tfjs-layers" "2.6.0" + argparse "^1.0.10" + chalk "^4.1.0" core-js "3" regenerator-runtime "^0.13.5" + yargs "^16.0.3" "@types/babel__core@^7.1.0": version "7.1.2" @@ -1322,6 +1325,11 @@ ansi-regex@^4.0.0, ansi-regex@^4.1.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -1334,6 +1342,13 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + ansi-wrap@0.1.0, ansi-wrap@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" @@ -1407,7 +1422,7 @@ arg@^4.1.0: resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== -argparse@^1.0.7: +argparse@^1.0.10, argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== @@ -1952,6 +1967,14 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0, chalk@^2.3.2, chalk@^2.4.1, chalk@^2.4 escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chalk@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" @@ -2057,6 +2080,15 @@ cliui@^5.0.0: strip-ansi "^5.2.0" wrap-ansi "^5.1.0" +cliui@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.1.tgz#a4cb67aad45cd83d8d05128fc9f4d8fbb887e6b3" + integrity sha512-rcvHOWyGyid6I1WjT/3NatKj2kDt9OdSHSXpyLXaMWFbKpGACNW8pRhhdPUq9MWUOdwn8Rz9AVETjF4105rZZQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -2082,11 +2114,23 @@ color-convert@^1.9.0: dependencies: color-name "1.1.3" +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + color-support@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" @@ -2624,6 +2668,11 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" +escalade@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.0.tgz#e8e2d7c7a8b76f6ee64c2181d6b8151441602d4e" + integrity sha512-mAk+hPSO8fLDkhV7V0dXazH5pDc6MrjBTPyD3VeKzxnVFjH1MIxbCdqGZB9O8+EwWakZs3ZCbDS4IpRt79V1ig== + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -3224,7 +3273,7 @@ get-caller-file@^1.0.1: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== -get-caller-file@^2.0.1: +get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== @@ -3377,6 +3426,11 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + has-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" @@ -5323,10 +5377,10 @@ node-fetch@^2.2.0: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== -node-fetch@~2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" - integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= +node-fetch@~2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== node-int64@^0.4.0: version "0.4.0" @@ -6976,6 +7030,15 @@ string-width@^4.1.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^5.2.0" +string-width@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" @@ -7011,6 +7074,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -7057,6 +7127,13 @@ supports-color@^6.1.0: dependencies: has-flag "^3.0.0" +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + symbol-tree@^3.2.2: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -7674,6 +7751,15 @@ wrap-ansi@^5.0.0, wrap-ansi@^5.1.0: string-width "^3.0.0" strip-ansi "^5.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -7771,6 +7857,11 @@ y18n@^3.2.1: resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== +y18n@^5.0.1: + version "5.0.2" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.2.tgz#48218df5da2731b4403115c39a1af709c873f829" + integrity sha512-CkwaeZw6dQgqgPGeTWKMXCRmMcBgETFlTml1+ZOO+q7kGst8NREJ+eWwFNPVUQ4QGdAaklbqCZHH6Zuep1RjiA== + yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" @@ -7797,6 +7888,11 @@ yargs-parser@^13.1.1: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^20.0.0: + version "20.2.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.1.tgz#28f3773c546cdd8a69ddae68116b48a5da328e77" + integrity sha512-yYsjuSkjbLMBp16eaOt7/siKTjNVjMm3SoJnIg3sEh/JsvqVVDyjRKmaJV4cl+lNIgq6QEco2i3gDebJl7/vLA== + yargs-parser@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" @@ -7839,6 +7935,19 @@ yargs@^14.0.0: y18n "^4.0.0" yargs-parser "^13.1.1" +yargs@^16.0.3: + version "16.0.3" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.0.3.tgz#7a919b9e43c90f80d4a142a89795e85399a7e54c" + integrity sha512-6+nLw8xa9uK1BOEOykaiYAJVh6/CjxWXK/q9b5FpRgNslt8s22F2xMBqVIKgCRjNgGvGPBy8Vog7WN7yh4amtA== + dependencies: + cliui "^7.0.0" + escalade "^3.0.2" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.1" + yargs-parser "^20.0.0" + yargs@^9.0.0: version "9.0.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-9.0.1.tgz#52acc23feecac34042078ee78c0c007f5085db4c" diff --git a/tfjs-react-native/package.json b/tfjs-react-native/package.json index 754b1756995..e85c99df3f4 100644 --- a/tfjs-react-native/package.json +++ b/tfjs-react-native/package.json @@ -33,9 +33,9 @@ }, "devDependencies": { "@react-native-community/async-storage": "^1.4.2", - "@tensorflow/tfjs-backend-cpu": "~2.0.0", - "@tensorflow/tfjs-backend-webgl": "~2.0.0", - "@tensorflow/tfjs-core": "~2.0.0", + "@tensorflow/tfjs-backend-cpu": "~2.6.0", + "@tensorflow/tfjs-backend-webgl": "~2.6.0", + "@tensorflow/tfjs-core": "~2.6.0", "@types/base64-js": "^1.2.5", "@types/jasmine": "~3.3.0", "@types/react-native": "0.60.2", @@ -64,7 +64,9 @@ }, "peerDependencies": { "@react-native-community/async-storage": "^1.4.2", - "@tensorflow/tfjs-backend-webgl": "~2.0.0", + "@tensorflow/tfjs-backend-webgl": "~2.6.0", + "@tensorflow/tfjs-backend-cpu": "~2.6.0", + "@tensorflow/tfjs-core": "~2.6.0", "expo-asset": "^7.0.0", "expo-camera": "^7.0.0", "expo-gl": "^7.0.0", diff --git a/tfjs-react-native/src/camera/camera_stream.tsx b/tfjs-react-native/src/camera/camera_stream.tsx index f720b55437c..22843ce1da6 100644 --- a/tfjs-react-native/src/camera/camera_stream.tsx +++ b/tfjs-react-native/src/camera/camera_stream.tsx @@ -60,8 +60,8 @@ const DEFAULT_RESIZE_DEPTH = 3; * component with the ability to yield tensors representing the camera stream. * * Because the camera data will be consumed in the process, the original - * camera component will not render any content. A provided by this component - * is used to render the camera preview. + * camera component will not render any content. This component provides + * options that can be used to render the camera preview. * * Notably the component allows on-the-fly resizing of the camera image to * smaller dimensions, this speeds up data transfer between the native and @@ -306,9 +306,9 @@ export function cameraWithTensors( const height = PixelRatio.getPixelSizeForLayoutSize( cameraLayout.height ); - const isFrontCamera = + const isFrontCamera = this.camera.props.type === Camera.Constants.Type.front; - const flipHorizontal = + const flipHorizontal = Platform.OS === 'ios' && isFrontCamera ? false : true; renderToGLView(gl, cameraTexture, { width, height }, flipHorizontal); diff --git a/tfjs-react-native/src/camera/camera_webgl_util.ts b/tfjs-react-native/src/camera/camera_webgl_util.ts index ba2e3429495..89c17c69af8 100644 --- a/tfjs-react-native/src/camera/camera_webgl_util.ts +++ b/tfjs-react-native/src/camera/camera_webgl_util.ts @@ -18,8 +18,6 @@ import {webgl_util} from '@tensorflow/tfjs-backend-webgl'; import * as tf from '@tensorflow/tfjs-core'; -import {getDebugMode} from '../platform_react_native'; - import * as drawTextureProgramInfo from './draw_texture_program_info'; import * as resizeBilinearProgramInfo from './resize_bilinear_program_info'; import * as resizeNNProgramInfo from './resize_nearest_neigbor_program_info'; @@ -68,24 +66,22 @@ export function downloadTextureData( } const fbo = fboCache.get(gl); - const debugMode = getDebugMode(); - - webgl_util.callAndCheck(gl, debugMode, () => { + webgl_util.callAndCheck(gl, () => { gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); }); - webgl_util.callAndCheck(gl, debugMode, () => { + webgl_util.callAndCheck(gl, () => { gl.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, texture); }); - webgl_util.callAndCheck(gl, debugMode, () => { + webgl_util.callAndCheck(gl, () => { const level = 0; gl.framebufferTexture2D( gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, level); }); - webgl_util.callAndCheck(gl, debugMode, () => { + webgl_util.callAndCheck(gl, () => { const format = depth === 3 ? gl.RGB : gl.RGBA; const x = 0; const y = 0; @@ -93,7 +89,7 @@ export function downloadTextureData( }); // Unbind framebuffer - webgl_util.callAndCheck(gl, debugMode, () => { + webgl_util.callAndCheck(gl, () => { gl.bindFramebuffer(gl.FRAMEBUFFER, null); }); return pixels; @@ -128,15 +124,13 @@ export function uploadTextureData( gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - const debugMode = getDebugMode(); - const level = 0; const format = dims.depth === 3 ? gl.RGB : gl.RGBA; const internalFormat = format; const border = 0; const type = gl.UNSIGNED_BYTE; - webgl_util.callAndCheck(gl, debugMode, () => { + webgl_util.callAndCheck(gl, () => { gl.texImage2D( gl.TEXTURE_2D, level, internalFormat, targetTextureWidth, targetTextureHeight, border, format, type, imageData); @@ -183,13 +177,11 @@ export function runResizeProgram( gl: WebGL2RenderingContext, inputTexture: WebGLTexture, inputDims: Dimensions, outputDims: Dimensions, alignCorners: boolean, interpolation: 'nearest_neighbor'|'bilinear') { - const debugMode = getDebugMode(); - const {program, vao, vertices, uniformLocations} = resizeProgram(gl, inputDims, outputDims, alignCorners, interpolation); gl.useProgram(program); // Set up geometry - webgl_util.callAndCheck(gl, debugMode, () => { + webgl_util.callAndCheck(gl, () => { gl.bindVertexArray(vao); }); @@ -235,7 +227,7 @@ export function runResizeProgram( const border = 0; const type = gl.UNSIGNED_BYTE; - webgl_util.callAndCheck(gl, debugMode, () => { + webgl_util.callAndCheck(gl, () => { gl.texImage2D( gl.TEXTURE_2D, level, internalFormat, targetTextureWidth, targetTextureHeight, border, format, type, null); @@ -365,7 +357,6 @@ function createProgramObjects( gl: WebGL2RenderingContext, vertexShaderSource: string, fragmentShaderSource: string, vertices: Float32Array, texCoords: Float32Array): ProgramObjects { - const debugMode = getDebugMode(); const vertShader = gl.createShader(gl.VERTEX_SHADER); gl.shaderSource(vertShader, vertexShaderSource); gl.compileShader(vertShader); @@ -385,7 +376,7 @@ function createProgramObjects( gl.bindVertexArray(vao); // Set up geometry - webgl_util.callAndCheck(gl, debugMode, () => { + webgl_util.callAndCheck(gl, () => { const positionAttrib = gl.getAttribLocation(program, 'position'); const vertsCoordsBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, vertsCoordsBuffer); @@ -395,7 +386,7 @@ function createProgramObjects( gl.bindBuffer(gl.ARRAY_BUFFER, null); }); - webgl_util.callAndCheck(gl, debugMode, () => { + webgl_util.callAndCheck(gl, () => { const texCoordsAttrib = gl.getAttribLocation(program, 'texCoords'); const texCoordsBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, texCoordsBuffer); @@ -406,7 +397,7 @@ function createProgramObjects( }); const uniformLocations = new Map(); - webgl_util.callAndCheck(gl, debugMode, () => { + webgl_util.callAndCheck(gl, () => { const inputTextureLoc = gl.getUniformLocation(program, 'inputTexture'); uniformLocations.set('inputTexture', inputTextureLoc); }); diff --git a/tfjs-react-native/src/platform_react_native.ts b/tfjs-react-native/src/platform_react_native.ts index 86e6aaa32e6..00ac4a7b094 100644 --- a/tfjs-react-native/src/platform_react_native.ts +++ b/tfjs-react-native/src/platform_react_native.ts @@ -23,15 +23,6 @@ import {Buffer} from 'buffer'; import {GLView} from 'expo-gl'; import {Platform as RNPlatform} from 'react-native'; -let debugMode_ = false; -export function setDebugMode(debugMode: boolean) { - debugMode_ = debugMode_; -} - -export function getDebugMode() { - return debugMode_; -} - // See implemetation note on fetch // tslint:disable-next-line:max-line-length // https://github.com/facebook/react-native/blob/0ee5f68929610106ee6864baa04ea90be0fc5160/Libraries/vendor/core/whatwg-fetch.js#L421 diff --git a/tfjs-react-native/yarn.lock b/tfjs-react-native/yarn.lock index 494b1643847..b09cf3e83ec 100644 --- a/tfjs-react-native/yarn.lock +++ b/tfjs-react-native/yarn.lock @@ -35,36 +35,36 @@ dependencies: defer-to-connect "^1.0.1" -"@tensorflow/tfjs-backend-cpu@2.0.0-rc.3": - version "2.0.0-rc.3" - resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-2.0.0-rc.3.tgz#cadcc99a366c13e9c346f78b23ceff8375cfc46b" - integrity sha512-qwg0GmfVRPaF4bMrzpWV2fcTnvU5f6UxsOySgso+3id3KbQmh89XZGtSLUJL4iw8P6HIxNiR++KJkygmQFWhDA== +"@tensorflow/tfjs-backend-cpu@2.6.0", "@tensorflow/tfjs-backend-cpu@~2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-2.6.0.tgz#bd0923ca438e945c4c9347a76e301a4fb1890d33" + integrity sha512-essk82VoET77tuFX5Sa9zv9F8d/2DxjEQ2RavoU+ugs0l64DTbdTpv3WdQwUihv1gNN7/16fUjJ6cG80SnS8/g== dependencies: "@types/seedrandom" "2.4.27" seedrandom "2.4.3" -"@tensorflow/tfjs-backend-webgl@2.0.0-rc.3": - version "2.0.0-rc.3" - resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-backend-webgl/-/tfjs-backend-webgl-2.0.0-rc.3.tgz#6bf36de6be2a7fecec17d1bce57daa233722685c" - integrity sha512-iWsuQ5M21lHulLwkAF1KilzCvXT1WCumCYcdYrBzKNT9Ghi0YoNbcoT8s1RRli2jhgy/YqBLLaRFXy9s0kJb0A== +"@tensorflow/tfjs-backend-webgl@~2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-backend-webgl/-/tfjs-backend-webgl-2.6.0.tgz#3855c254a86daf28511530c36bb61938acf26740" + integrity sha512-j1eNYKIpO06CTSRXiIWdpZ2iPDBkx7PPl7K/1BtCEW/9FP7Q0q3doHKNmTdOPvuw7Dt1nNHEMnba0YB2lc5S7Q== dependencies: - "@tensorflow/tfjs-backend-cpu" "2.0.0-rc.3" + "@tensorflow/tfjs-backend-cpu" "2.6.0" "@types/offscreencanvas" "~2019.3.0" "@types/seedrandom" "2.4.27" "@types/webgl-ext" "0.0.30" "@types/webgl2" "0.0.4" seedrandom "2.4.3" -"@tensorflow/tfjs-core@2.0.0-rc.3": - version "2.0.0-rc.3" - resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-core/-/tfjs-core-2.0.0-rc.3.tgz#a665a1a4106c6bc802762c4a4f022d4971908cd2" - integrity sha512-EvsGWWwoDX3lD7YujlMlv9DRCKAEZevzWjO5cE8vJnZkVToQ3B5l5fsUH2eGoe/+6FHUPr2HfkwU/492/sfOiQ== +"@tensorflow/tfjs-core@~2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-core/-/tfjs-core-2.6.0.tgz#ab2f2c9e8f46990643076d7d5bdb912885282bd2" + integrity sha512-akUB1iz663UCUdOfEUu91XeHzGpdYtdtMPxjsGEdF0CwENzSAcvHzQrEVoPBRD+RKpxrVXvQBoOd7GYBxMIIKQ== dependencies: "@types/offscreencanvas" "~2019.3.0" "@types/seedrandom" "2.4.27" "@types/webgl-ext" "0.0.30" "@types/webgl2" "0.0.4" - node-fetch "~2.1.2" + node-fetch "~2.6.1" seedrandom "2.4.3" "@types/base64-js@^1.2.5": @@ -1195,10 +1195,10 @@ ncp@^2.0.0: resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M= -node-fetch@~2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" - integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= +node-fetch@~2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.5.0"