I'm running into a roadblock as to how to deal with this issue. For instance, if someone takes a picture of, say, a screwdriver, I want my app to be able to identify the screwdriver as well as black it out. I think I would use CoreML/Vision to identify the screwdriver, but how would I get an image that is just the screwdriver (not the surrounding background), so that I can manipulate the pixels on the screwdriver part of the image only? Thanks all!
Asked
Active
Viewed 31 times
1
-
Hi and welcome to StackOverflow. Why do you want to get an image of only the screwdriver without the background? You're model should be able to identify the scredriver within the surrounding background, shoudn't it? Similar tasks to this have already been solved. Have a look at the current benchmark models for CIFAR 100 and use this as a starting point. – pythonic833 Jun 12 '20 at 23:04
-
@pythonic833 Well, I want my model to identify the screwdriver, however I want to manipulate the pixels of only the screwdriver. Is there a simple way to do this? I feel like I'm missing something – user13736502 Jun 13 '20 at 00:16
-
@pythonic833 Thanks for the welcome and advice btw :) – user13736502 Jun 13 '20 at 00:17
-
Well you need a whole lot of labeled pictures with screwdrivers from different angles and in various surroundings. Then you could preprocess your pictures to have the same shape as e.g. CIFAR 100 pictures and just change the labels: everything in CIFAR 100 is class 0 (not a screwdriver) and every screwdriver is class 1. Now you can train your model, which you might try similarly as done in the CIFAR 100 benchmarks. You could of course just add the screwdrivers to CIFAR 100 and predict 101 classes, too. – pythonic833 Jun 13 '20 at 00:17
-
@pythonic833 Sorry I'm not quite understanding you (I'm working in Swift/UIKit btw, if that gives context). My understanding is that after I train an image recognition model, if I pass in a screwdriver, it outputs the label. However, what I need my model to do is not only recognize look for and identify the screwdriver, but also isolate the screwdriver from the rest of the background so I can manipulate the image of the screwdriver only (for instance, blacking out all the pixels of the screwdriver). I think I understand training the model it's just that step that I don't get. – user13736502 Jun 13 '20 at 14:45