Skip to content

Commit

Permalink
fixed pixel resizing bug -- imagenet example now working
Browse files Browse the repository at this point in the history
  • Loading branch information
genekogan committed Jan 28, 2017
1 parent ad9f4fd commit 4da6c15
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ofxDarknet.cpp
Expand Up @@ -102,11 +102,12 @@ std::vector< classification > ofxDarknet::classify( ofPixels & pix, int count )
{
int *indexes = ( int* ) calloc( count, sizeof( int ) );

if( pix.getWidth() != net.w && pix.getHeight() != net.h ) {
pix.resize( net.w, net.h );
ofPixels pix2( pix );
if( pix2.getWidth() != net.w && pix2.getHeight() != net.h ) {
pix2.resize( net.w, net.h );
}

image im = convert( pix );
image im = convert( pix2 );

float *predictions = network_predict( net, im.data1 );

Expand Down

0 comments on commit 4da6c15

Please sign in to comment.