Downloads


In order to use the offline tester / visualizer tool for testing your solution locally, you'll have to modify your solution by adding the main method that interacts with the tester / visualizer via reading data from standard input and writing data to standard output. As long as you do not change the implementation of method recognizeObjects, this doesn't affect the way your solution works when being submitted to our server.

To simulate a single test case, your program should implement the following protocol (each integer/string is to be read from / printed in a separate line):

In other words, you should implement the following pseudocode in the main method of your solution:

    len = parseInt(readLine())

    for (i=0; i < len; i++)
        leftEyeImage[i] = parseInt(readLine())

    for (i=0; i < len; i++)
        rightEyeImage[i] = parseInt(readLine())

    ret = recognizeObjects(leftEyeImage, rightEyeImage)

    for (i=0; i < 22; i++)
        printLine(ret[i])

    flush(stdout)

The tester can be run in 6 different modes.

1: java -jar tester.jar -conv <image file> -out <output file>

The tester will load the "image file", convert it into an array of integers A (according to the format specified in the statement) and will save A into the "output file" as follows:

N (length of A)
A[0]
A[1]
...
A[N-1]

NOTE: in all modes, the tester is able to process the provided training images, but it is not guaranteed to be able to work with any other images.

2: java -jar tester.jar -folder <folder> -img <image> -exec <exec command> -model <model file> -vis <image prefix>

This is the most powerful mode. Your solution supplied by "exec command" will be executed on an images specified by "folder" and "image". The return value will then be scored against the model answer in the "model file". Both your and model answers will be visualized and the result will be saved to files specified by "image prefix".

"exec command" should contain a path to an executable of your solution. "model file" should point to the supplied model.csv (or another file in the same format). "folder" and "image" are image parameters given in the first two columns of model.csv. In particular, the left and right images should be located in folder "folder" and have names of LeftImage_"image" and RightImage_"image". The model file needs to contain an entry for the given values of "folder" and "image".

Visualization results will be saved in PNG format into files "image prefix"_left.png and "image prefix"_right.png. Each object in a model answer is visualized with a blue circle and a 0-based object number below the circle. Each object in your answer is visualized with a green circle (if you determine object's state correctly) or a red circle (if you determine state incorrectly) and a 0-based object number above the circle. Object with state HIDDEN and objects located at (-1, -1) are not visualized.

Notes:

3: java -jar tester.jar -folder <folder> -img <image> -exec <exec command> -vis <image prefix>

Your solution will be executed and the result will be printed and visualized, but not scored.

4: java -jar tester.jar -folder <folder> -img <image> -exec <exec command> -model <model file>

Your solution will be executed and the result will be scored, but not visualized.

5: java -jar tester.jar -folder <folder> -img <image> -model <model file> -vis <image prefix>

The model answer for the given image will be visualized. No solution will be run.

6: java -jar tester.jar -folder <folder> -img <image> -exec <exec command>

Your solution will be executed and the result will be printed, but not scored or visualized.

 

Sample usage

Download the training data, put it into some folder at your machine and extract archives. The contents of your folder should be like:

ISS
Lab
Lab2
Lab3
Sim
model.csv

Modify your solution as explained above and put the executable (solution or solution.exe) into the same folder. Also put the provided tester.jar there.

Now you can run the tester like this:

java -jar tester.jar -folder ISS -img UGKE.tif -exec solution[.exe] -model model.csv -vis result

This will execute your solution using a pair of images LeftImage_UGKE.tif and RightImage_UGKE.tif from ISS folder. The correctness score and its breakdown by objects will be printed to the standard output. The visualizations will be saved to images result_left.png and result_right.png.

 

Final notes

You can print any debug information of your solution to the standard error stream and it will be forwarded to the standard output of the tester.

For more information on using visualizers, please check the following recipe draft from TopCoder Cookbook. Note that this is not a troubleshooting thread, please use the match forum for questions instead.