Coder Social home page Coder Social logo

Comments (19)

S4WRXTTCS avatar S4WRXTTCS commented on May 15, 2024 1

@raaka1

The dataset for the object detection consist of 271 images, and the dataset for the image classification consists of a little over 1000 images.

I'll likely add more images to the object detection to better detect cards at different distances. Right now it's pretty locked to a certain distance away from the cards, and with using a USB camera (to mount it facing down).

from jetson-inference.

S4WRXTTCS avatar S4WRXTTCS commented on May 15, 2024 1

The DetectNet training data is here
https://drive.google.com/file/d/0B8dR1eAmu3fTR3l4WkNtR0dqS0E/view?usp=sharing

The ImageNet training data is here
https://drive.google.com/file/d/0B8dR1eAmu3fTcG1mZVN4OHFNTU0/view?usp=sharing

from jetson-inference.

dusty-nv avatar dusty-nv commented on May 15, 2024

from jetson-inference.

S4WRXTTCS avatar S4WRXTTCS commented on May 15, 2024

Thanks. It seems to load fine.

Now I just have to figure out how to get the image data within the boundary box (from detectnet) into another memory buffer for the classify function. Or expand the classify function to work on a ROI.

I probably should have started with learning about how to use CUDA on some basic level before playing around with this. :-)

from jetson-inference.

dusty-nv avatar dusty-nv commented on May 15, 2024

from jetson-inference.

S4WRXTTCS avatar S4WRXTTCS commented on May 15, 2024

Thanks.

I copied the gpuPreImageNetMean to new function that works on a region of interest of the live camera image coming in. Where the ROI is from the boundary box of the DetectNet.

It's pretty neat seeing detectnet detect the objects, and then imagenet classify them all while running live.

Here is the function I added to do deal with a ROI of interest on the 1280x720 incoming image. I believe it works correctly from the limited testing I've done.

// gpuPreImageNetMeanROI
global void gpuPreImageNetMeanROI( float2 scale, float4* input, int iWidth, float* output, int oWidth, int oHeight, int roix_start, int roiy_start, float3 mean_value )
{
const int x = blockIdx.x * blockDim.x + threadIdx.x;
const int y = blockIdx.y * blockDim.y + threadIdx.y;
const int n = oWidth * oHeight;

if( x >= oWidth || y >= oHeight )
	return;

const int dx = ((float)x * scale.x) + (float)roix_start;
const int dy = ((float)y * scale.y) + (float)roiy_start;
   
    const float4 px  = input[ dy * 1280 + dx ];
const float3 bgr = make_float3(px.z - mean_value.x, px.y - mean_value.y, px.x - mean_value.z);

output[n * 0 + y * oWidth + x] = bgr.x;
output[n * 1 + y * oWidth + x] = bgr.y;
output[n * 2 + y * oWidth + x] = bgr.z;

}

from jetson-inference.

S4WRXTTCS avatar S4WRXTTCS commented on May 15, 2024

Here is what I did with this project.

notskynetyet

from jetson-inference.

dusty-nv avatar dusty-nv commented on May 15, 2024

That's really cool! I appreciate the novel use of pipelining detectNet and imageNet. I would like to highlight that approach in the tutorial, maybe we can collaborate to use your application as an example if you are willing?

In practice, do you have any plans for the card detection system? Nice work!

from jetson-inference.

S4WRXTTCS avatar S4WRXTTCS commented on May 15, 2024

Yeah, I can share the Datasets and the Models along with the code. Now keep in mind the code is really just a bunch of hack of your code, and I probably didn't do things the right way. So it's going to need some fixing. The collaboration would benefit me as I'm new to this CUDA stuff, and hopefully other people can use it to do some cool things with it.

I also hacked in an image/label saving tool. So it saves not just the image, but the label file as well. That enabled me to quickly add more data to the dataset. Where I could easily fix the boundary boxes (for detectnet) or fix the classification (for imagenet).

I picked playingcards so I could share the code/data/model without revealing anything about what I'm actually working on for work. It's using the same type of pipeline, but different data.

As a hobby project I might finish it up to play a game of 21 with the user. Where the user has to be the dealer, and the computer card counts.

from jetson-inference.

S4WRXTTCS avatar S4WRXTTCS commented on May 15, 2024

I uploaded my AlexNet based model for the playing card identification, and the DetectNet model for detecting the playing card. But, for some reason wget doesn't download them correctly.

I edited the link in the same way that the CMakePreBuild.sh has them, but it ends up saving a very small file that isn't correct.

Here are the links with the original formatting.

AlexNet
https://drive.google.com/file/d/0B8dR1eAmu3fTWWpkSEVLV0Z5TVE/view?usp=sharing

CardNet (DetectNet Cased)
https://drive.google.com/file/d/0B8dR1eAmu3fTMU9Vb3p1S05Bclk/view?usp=sharing

Here is the modified wget line for AlexNet
wget --no-check-certificate 'https://drive.google.com/uc?export=download&id=0B8dR1eAmu3fTWWpkSEVLV0Z5TVE' -O alexnet_54cards.tar.gz

Is there something I'm missing? I uploaded the files simply using a chrome client to google drive and then shared them via a public link.

from jetson-inference.

S4WRXTTCS avatar S4WRXTTCS commented on May 15, 2024

Apparently this is because of a "Google cannot provide a virus scan" error message.

http://unix.stackexchange.com/questions/136371/how-to-download-a-folder-from-google-drive-using-terminal

In the above link there is a solution, and the solution works. But, I don't know how to return the code it sends. For now I just reuse the same code that it gave me the first time, but I'm sure that will break.

from jetson-inference.

dusty-nv avatar dusty-nv commented on May 15, 2024

from jetson-inference.

S4WRXTTCS avatar S4WRXTTCS commented on May 15, 2024

Yeah, I might try Box and another option is this utility which seems to work great.

https://github.com/circulosmeos/gdown.pl

So I can download that in the script file and then use it.

I can't use dropbox because my work internet blocks them all the time (but, not always which is weird).

from jetson-inference.

raaka1 avatar raaka1 commented on May 15, 2024

How many images did you use for training ?

Regards

from jetson-inference.

S4WRXTTCS avatar S4WRXTTCS commented on May 15, 2024

I uploaded a very primitive blackjack type game using this dual method detection/classification.

https://github.com/S4WRXTTCS/jetson-inference

It's not really suited for the onboard camera (what it defaults to) so it's best to switch to the USB camera.

There are some bugs like crashing when the card is half off the screen, and stuff like that.

I haven't updated the readme yet, but I'll get around to it once I've added some of my other code.

from jetson-inference.

raaka1 avatar raaka1 commented on May 15, 2024

Can you share the training data ? :)

from jetson-inference.

raaka1 avatar raaka1 commented on May 15, 2024

Thanks , i will let you know if there are issues.

from jetson-inference.

S4WRXTTCS avatar S4WRXTTCS commented on May 15, 2024

I fixed an issue with the cropping of the boundary boxes causing it to crash, and I also edited the Readme to add some information as to what it is.

from jetson-inference.

S4WRXTTCS avatar S4WRXTTCS commented on May 15, 2024

I added a Dual Net example. Basically it's detectnet-camera that crops the boundary boxes, and sends the image data from each one to ImageNet for classification.

That's likely the last thing I'll add to it for now.

from jetson-inference.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.