Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clearscreen for windows #792

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/art.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "classifier.h"
#ifdef WIN32
#include <time.h>
#include <stdlib.h>
#include "gettimeofday.h"
#else
#include <sys/time.h>
Expand Down Expand Up @@ -40,8 +41,12 @@ void demo_art(char *cfgfile, char *weightfile, int cam_index)

float *p = network_predict(net, in_s.data);

printf("\033[2J");
printf("\033[1;1H");
#ifdef WIN32
system("cls");
#else
printf("\033[2J");
printf("\033[1;1H");
#endif

float score = 0;
for(i = 0; i < n; ++i){
Expand Down
30 changes: 20 additions & 10 deletions src/classifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "dark_cuda.h"
#ifdef WIN32
#include <time.h>
#include <stdlib.h>
#include "gettimeofday.h"
#else
#include <sys/time.h>
Expand Down Expand Up @@ -1129,10 +1130,12 @@ void threat_classifier(char *datacfg, char *cfgfile, char *weightfile, int cam_i
sprintf(buff, "tmp/threat_%06d", count);
//save_image(out, buff);

#ifndef _WIN32
printf("\033[2J");
printf("\033[1;1H");
#endif
#ifdef WIN32
system("cls");
#else
printf("\033[2J");
printf("\033[1;1H");
#endif
printf("\nFPS:%.0f\n",fps);

for(i = 0; i < top; ++i){
Expand Down Expand Up @@ -1208,8 +1211,12 @@ void gun_classifier(char *datacfg, char *cfgfile, char *weightfile, int cam_inde
float *predictions = network_predict(net, in_s.data);
top_predictions(net, top, indexes);

printf("\033[2J");
printf("\033[1;1H");
#ifdef WIN32
system("cls");
#else
printf("\033[2J");
printf("\033[1;1H");
#endif

int threat = 0;
for(i = 0; i < sizeof(bad_cats)/sizeof(bad_cats[0]); ++i){
Expand Down Expand Up @@ -1308,10 +1315,13 @@ void demo_classifier(char *datacfg, char *cfgfile, char *weightfile, int cam_ind
if(net.hierarchy) hierarchy_predictions(predictions, net.outputs, net.hierarchy, 1);
top_predictions(net, top, indexes);

#ifndef _WIN32
printf("\033[2J");
printf("\033[1;1H");
#endif
#ifdef WIN32
system("cls");
#else
printf("\033[2J");
printf("\033[1;1H");
#endif
printf("\nFPS:%.0f\n",fps);


if (!benchmark) {
Expand Down
1 change: 1 addition & 0 deletions src/demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "darknet.h"
#ifdef WIN32
#include <time.h>
#include <stdlib.h>
#include "gettimeofday.h"
#else
#include <sys/time.h>
Expand Down
1 change: 1 addition & 0 deletions src/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ void draw_detections(image im, int num, float thresh, box *boxes, float **probs,
}
}


void transpose_image(image im)
{
assert(im.w == im.h);
Expand Down