5 ms·
It's actually written in React Native with a fair bit of C++ (TensorFlow), and some Objective-C++ to glue the two. One cool thing we added on top of React Nativ
by timanglade 9y ago
It's actually written in React Native with a fair bit of C++ (TensorFlow), and some Objective-C++ to glue the two. One cool thing we added on top of React Native was a hack to let us inject new versions of our deep learning model on the fly without going through an App Store review. If you thought injecting JavaScript to change the behavior of your app was cool, you need to try injecting neural nets, it's quite a feeling :D
- codesternews 9y agocan you please open source it. It would be great if you open source it.
- kgc 9y agoWhat was the hack?
- asadlionpk 9y agoWhen using React Native (and also storing your network in JS) you can choose to push updates and fixes to JS part of your code without going through store again. Check: http://microsoft.github.io/code-push/ http://microsoft.github.io/code-push/
- timanglade 9y agoYup that's basically it. The hack was just in getting Tensorflow to accept/load its neural network definition from the JS bundle (what CodePush distributes for you) rather than from the main Cocoa bundle.
- Grustaf 9y agoReally cool stuff! I didn't even realise you've switched jobs, but that explains why I didn't see you when we popped in at Townsend the other day! Keep up the good work.
- joncrocks 9y agoJust as a note, people/developers have had messages from Apple telling them that they need to remove code which allows them to update their app outside of the app update/review process. See https://news.ycombinator.com/item?id=13817557 https://news.ycombinator.com/item?id=13817557 for some more detail/discussion. [edit: Apart from in Apple-approved manners]
- B1FF_PSUVM 9y agoWell, that's not gonna fly with the "code is data, data is code" crowd ... If the newspaper apps get to load fresh front page images, why should a poor neural net be discriminated in its quest for fresh coefficients? (Raw oppression and injustice there, get yer indignation reservoir topped up.)
- deleted 9y ago[deleted]
- Kiro 9y agohttps://developer.apple.com/programs/ios/information/iOS_Program_Information_4_3_15.pdf https://developer.apple.com/programs/ios/information/iOS_Pro... > 3.3.2 […] The only exception to the foregoing is scripts and code downloaded and run by Apple’s built-in WebKit framework or JavascriptCore […]
- wcummings 9y agoI'm surprised Apple allows this, I thought they hated this kind of thing.
- tomduncalf 9y agoThis looks great, haha! Shame I can't access it from the UK. It would be really interesting to read more about your thoughts on working with RN and C++ and perhaps how you did some of it. I'm currently doing the same (but with a C++ audio engine rather than image processing stuff) and I think it's an incredibly powerful combination - but I do feel like I'm making up some interop patterns as I go and there might be better ways, so would love to hear how other people use it! Broadly, I've created a "repository" singleton that stores a reference to both the React Native module instance (which gets set when I call its setup method from JS) and the C++ main class instance (which gets set when it starts up), so they can get a handle on each other (I bet there are better ways to do this, but I'm new to C++/ObjC and couldn't work out a better way to get a reference to the RN module). I'm then using RCT_EXPORT_METHOD to provide hooks for JS to call into C++ via an ObjC bridge (in an RCT_EXPORT_MODULE class), and using the event emitter to communicate back to JS (so the C++ can get the RN module instance from the singleton and call methods which emit events). I've not done anything that really pushes the bridge performance to a point where I've seen any noticeable latency/slow down caused by the interop - have you had any issues here? Like I say, I'm finding a really cool way to build apps that need the power of native code but still with the ease of RN as the GUI and some logic, and I actually quite like the separation it enforces with the communication boundary.
- timanglade 9y agoSounds like you're further ahead than I was with the React Native part! Not Hotdog is very simple so I just wrote a simple Native module around my TensorFlow code and let the chips fall where they may performance-wise. The snap/analyze/display sequence is slow enough that I don't need to worry about fps or anything like that. As much as I enjoyed using RN for this app, I would probably move to native code if I needed to be able to tune performance.
- 1zee 9y agoCan you explain to a noob how you wrote the Native module around TensorFlow? My main area of focus is in python, but I feel hindered when I think I'm ready to start developing for mobile apps. I'm looking into RN, but still not sure how that plays with TF and other python modules.
- had2makeanacct 9y agoI really have no idea what any of that means, no Android then?
- austinn 9y agohttps://play.google.com/store/apps/details?id=com.refect.nothotdog https://play.google.com/store/apps/details?id=com.refect.not...
- dustedrob 9y agoIt would be relatively easy to port to Android. Please open source it!
- porker 9y agoNice! I'd never known that C++ could be used in an iOS app; learned something new today thanks.
- peterjlee 9y agoSo what you're saying is you can update the neural net to do dick or not dick without going through the App Store review?
- cedobbs10 9y agoHey guys, how would I be able to add characters to an account for injustice and then disable the anti-cheat. I want to basically make it so that i cant get banned for using characters I added to my account.