TFJS selfie_segmentation face swap demo - tensorflow

The demo selfie_segmentation shows some kind of inpainting of the mona lisa over your own face segmentation. I tried to play with this, but i cannot find any hints on how this is achieved. I tried browsing through the source code, but it seems very generic and could not find anything specific for this particular effect (as if the mono lisa effect is encoded in the model itself?). There isnt even any mona lisa related asset downloaded when loading the page, and no references to related assets in the source code. Can anyone hint me how i could try this with different face projections?

Related

video object classification suggestion

I am trying to build an outdoor smoke detection from the neighbor chimneys.
I live in a neighborhood where a couple of houses are still using wood-burning fireplaces and cause lots of smoke and they do during the day time. when it is smoky outside, the kid's room sometime has windows open and smoke get in and very hard to get smoke out. The worst part is it is not illegal (yet) so I found little help apart from talking to them and react to it quickly, in vain.
I am thinking to have an outdoor camera looking at chimneys and detect smoke. Then a program sends a text message for alerting. Most time, the image is pretty still and not a lot of variations. It shouldn't be a too hard problem for classification I imagine? I have little experience with Tensorflow or machine learning but I am a good programmer. So given some direction and some existing model, I hope I can get this working...
I know this sounds desperate, nevertheless, for a good deed. Please help.
For fire and smoke classification, you can check the following tutorial: https://www.pyimagesearch.com/2019/11/18/fire-and-smoke-detection-with-keras-and-deep-learning/.
PyImageSearch is a very good website for image processing, you can find there many articles which can help you (even deployment of neural networks on RaspberryPi and so on).

Make blender verticles not move while posing

I am totally new to blender. I know to create objects but rigging is lite problem to me. I downloaded male model with everything but problem is now when i move his arm (bend it with bones), his neck get off head (2 separated objects).
Here is the image what happens. What can i do?
Before:
After:
its a bit hard to see, but if the head comes loose, then the problem is in the model. One could fix it by repairing the model, in mesh edit, make it one connected object, as a result of that, when changing the mesh(add and connect surfaces) the the weights of the orginal model wont work anymore on the model. So then you would need to reaply weights from bones to the meshmodel.
As you said your totally new to blender, i think all those steps would be a bit to much (i have repaired meshes but i got 5 years of experience), for you repairing a model might be a bit too complex (its advanced stuff usually a few hours of blender work to fix something).
It might be much easier to startoff with correct models, you can get them at blendswap, or you could install the Bastioni addon, he's one of the MakeHuman creators and transformed that code into blender. Look for Bastioni and you get real good human models who you can pose.

Textsum - Incorrect decode results compared to ref file

This issue is seen when performing training against my own dataset which was converted to binary via data_convert_example.py. After a week of training I get decode results that don't make sense when comparing the decode and ref files.
If anyone has been successful and gotten results similar to what is posted in the Textsum readme using their own data, I would love to know what has worked for you...environment, tf build, number of articles.
I currently have not had luck with 0.11, but have gotten some results with 0.9 however the decode results are similar to those shown below which I have no idea where they are even coming from.
I currently am running Ubuntu 16.04, TF 0.9, CUDA 7.5 and CuDnn 4. I tried TF 0.11 but was dealing with other issues so I went back to 0.9. It does seem that the decode results are being generated from valid articles, but the reference file and decode file indicies have NO correlation.
If anyone can provide any help or direction, it would be greatly appreciated. Otherwise, should I figure anything out, I will post here.
A few final questions. Regarding the vocab file referenced. Does it at all need to be sorted by word frequency at all? I never performed anything along these lines when generating it and just wasn't sure if this would throw something off as well.
Finally, I made the assumption in generating the data that the training data articles should be broken down into smaller batches. I separated out the articles into multiple files of 100 articles each. These were then named data-0, data-1, etc. I assume this was a correct assumption on my part? I also kept all the vocab in one file which has not seemed to throw any errors.
Are the above assumptions correct as well?
Below are some ref and decode results which you can see are quite odd and seem to have no correlation.
DECODE:
output=Wild Boy Goes About How I Can't Be Really Go For Love
output=State Department defends the campaign of Iran
output=John Deere sails profit - Business Insider
output=to roll for the Perseid meteor shower
output=Man in New York City in Germany
REFERENCE:
output=Battle Chasers: Nightwar Combines Joe Mad's Stellar Art With Solid RPG Gameplay
output=Obama Meets a Goal That Could Literally Destroy America
output=WOW! 10 stunning photos of presidents daughter Zahra Buhari
output=Koko the gorilla jams out on bass with Flea from Red Hot Chili Peppers
output=Brenham police officer refused service at McDonald's
Going to answer this one myself. Seems the issue here was the lack of training data. In the end I did end up sorting my vocab file, however it seems this is not necessary. The reason this was done, was to allow the end user to limit the vocab words to something like 200k words should they wish.
The biggest reason for the problems above were simply the lack of data. When I ran the training in the original post, I was working with 40k+ articles. I thought this was enough but clearly it wasn't and this was even more evident when I got deeper into the code and gained a better understanding as to what was going on. In the end I increased the number of articles to over 1.3 million, I trained for about a week and a half on my 980GTX and got the average loss to about 1.6 to 2.2 I was seeing MUCH better results.
I am learning this as I go, but I stopped at the above average loss because some reading I performed stated that when you perform "eval" against your "test" data, your average loss should be close to what you are seeing in training. This helps to determine whether you are getting close to over-fitting when these are far apart. Again take this with a grain of salt, as I am learning but it seems to make sense logically to me.
One last note that I learned the hard way is this. Make sure you upgrade to the latest 0.11 Tensorflow version. I originally trained using 0.9 but when I went to figure out how to export the model for tensorflow, I found that there was no export.py file in that repo. When I upgrades to 0.11, I then found that the checkpoint file structure seems to have changed in 0.11 and I needed to take another 2 weeks to train. So I would recommend just upgrading as they have resolved a number of the problems I was seeing during the RC. I still did have to set the is_tuple=false but that aside, all has worked out well. Hope this helps someone.

Object detection using Kinect V2

I know that object detection is not possible using Kinect v1. We need to use 3rd party libraries like open CV or pointclouds (pcl).
But was just curious to know does can it be achived using Kinect v2? Has anyone done any work on it?
Take a look at this project and use google with blob detection keyword.
The short answer is that object detection using the Kinect V2 is possible in two ways, but there isn't much by way of complete solutions out there right now (Nov. 2014) because of how new it is and because it hasn't been hacked yet. Currently, I am trying to implement PCL on Windows 8 with visual studio 2012, which are the bare minimum req.s for Kinect v2, and I will keep posted so that you can know how it goeshttp://cs.unc.edu/~kwaegel/pcl/pcl_build_notes.htmlRealistically, the fastest approach would likely be using the v2 SDK (sorry about the link above, don't have enough reputation to share more than 2 links, needed to think of a clever way to get it to you without StackExchange recognizing it as a link :P ). In a brief search I found that this guy acquired the color point clouds from the kinect v2 and was able to output them:
http://laht.info/kinect-v2-colored-point-clouds/
After that, you should be able to segment the point clouds with previous open source software by simply importing your newly acquired point cloud!
http://pointclouds.org/documentation/tutorials/random_sample_consensus.php
again, haven't gotten all of these moving parts working together in one environment yet, but it is definitely possible

Does anyone have any idea how to create a 2D skeleton with the Kinect depthmap?

I'm currently using a Processing Kinect library which supplies a depth map. I was wondering how I could take that and use it to create a 2D skeleton, if possible. Not looking for any code here, just a general process I could use to achieve those results.
Also, given that we've seen this in several of the Kinect games so far, would it be difficult to have multiple skeletons running at once?
Disclaimer: the reason why you still didn't get an answer for this question is probably because that's a current research problem. So I can't give you a direct answer but will try to help with some information and useful resources for this topic.
There are mainly 2 different approaches to create a skeleton from a depth map. The first one is to use machine learning, the second is purely algorithmic.
For the machine learning one, you'd need many samples of people doing a predetermined move, and use those samples to train your favorite learning algorithm. That's the approach that was taken and implemented by Microsoft in the XBox (source), it works really well BUT you need millions of samples to make it reliable... quite a drawback.
The "algorithmic" approach (understand without using a training set) can be done in many different ways and is a research problem. It's often based on modeling the possible body postures and trying to match that with the depth image received. That's the approach that was chosen by PrimeSense (the guys behind the kinect depth camera technology) for their skeleton tracking tool NITE.
The OpenKinect community maintains a wiki where they list some interesting research material about this topic. You might also be interested in this thread on the OpenNI mailing list.
If you're looking for an implementation of a skeleton tracking tool, PrimeSense released NITE (closed source), the one they made: it's part of the OpenNI framework. That's what's used in most of the videos you might have seen that involve skeleton tracking. I think it's able to handle up to 2 skeletons at the same time, but that requires confirmation.
The best solution is to use FAAST (http://projects.ict.usc.edu/mxr/faast/) which requires OpenNI. I have struggled to get OpenNI to work on my computer. I have not seen an approach yet using Code Laboratories' CL NUI.
An algorithmic approach is http://code.google.com/p/skeletonization/ but you may have a problem because your depthmap only represents surfaces and no closed objects.