Skip to content

Commit c325ff9

Browse files
committed
Convert DnnDetector's test image to PPM
YARP 3.3 doesn't support PNG.
1 parent bffe07c commit c325ff9

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

examples/cpp/exampleDnnDetector/exampleDnnDetector.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ int main(int argc, char * argv[])
3737

3838
yarp::os::ResourceFinder rf;
3939
rf.setDefaultContext("DnnDetector");
40-
std::string qrFullName = rf.findFileByName("tests/teddy-bear.png");
40+
std::string qrFullName = rf.findFileByName("tests/teddy-bear.ppm");
4141

4242
yarp::sig::ImageOf<yarp::sig::PixelRgb> yarpImgRgb;
4343

44-
if (!yarp::sig::file::read(yarpImgRgb, qrFullName, yarp::sig::file::FORMAT_PNG))
44+
if (!yarp::sig::file::read(yarpImgRgb, qrFullName, yarp::sig::file::FORMAT_PPM))
4545
{
4646
yError() << "Image file not available";
4747
return 1;

examples/python/exampleDnnDetector.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
detectorOptions = yarp.Property()
77
detectorOptions.put("device", "DnnDetector")
8-
detectorOptions.put("trainedModel", "yolov3-tiny.weights")
9-
detectorOptions.put("configDNNModel", "yolov3-tiny.cfg")
8+
detectorOptions.put("trainedModel", "yolov3-tiny/yolov3-tiny.weights")
9+
detectorOptions.put("configDNNModel", "yolov3-tiny/yolov3-tiny.cfg")
1010
detectorOptions.put("classesTrainedModel", "coco-object-categories.txt")
1111

1212
detectorDevice = yarp.PolyDriver(detectorOptions)
@@ -19,10 +19,10 @@
1919

2020
rf = yarp.ResourceFinder()
2121
rf.setDefaultContext("DnnDetector")
22-
sampleFullName = rf.findFileByName("tests/teddy-bear.png")
22+
sampleFullName = rf.findFileByName("tests/teddy-bear.ppm")
2323
yarpImgRgb = yarp.ImageRgb()
2424

25-
if not yarp.read(yarpImgRgb, sampleFullName, yarp.FORMAT_PNG):
25+
if not yarp.read(yarpImgRgb, sampleFullName, yarp.FORMAT_PPM):
2626
print("Image file not available")
2727
raise SystemExit
2828

share/DnnDetector/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ if(DOWNLOAD_MODELS)
1212
DESTINATION ${ROBOTICSLAB-VISION_CONTEXTS_INSTALL_DIR}/DnnDetector)
1313
endif()
1414

15-
yarp_install(FILES tests/teddy-bear.png
15+
yarp_install(FILES tests/teddy-bear.ppm
1616
DESTINATION ${ROBOTICSLAB-VISION_CONTEXTS_INSTALL_DIR}/DnnDetector/tests)
-111 KB
Binary file not shown.
297 KB
Binary file not shown.

tests/testDnnDetector.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ TEST_F(DnnDetectorTest, DnnDetector2)
6666
{
6767
yarp::os::ResourceFinder rf;
6868
rf.setDefaultContext("DnnDetector");
69-
std::string qrFullName = rf.findFileByName("tests/teddy-bear.png");
69+
std::string qrFullName = rf.findFileByName("tests/teddy-bear.ppm");
7070
ASSERT_FALSE(qrFullName.empty());
7171

7272
yarp::sig::ImageOf<yarp::sig::PixelRgb> yarpImgRgb;
73-
ASSERT_TRUE(yarp::sig::file::read(yarpImgRgb, qrFullName, yarp::sig::file::FORMAT_PNG));
73+
ASSERT_TRUE(yarp::sig::file::read(yarpImgRgb, qrFullName, yarp::sig::file::FORMAT_PPM));
7474

7575
yarp::os::Bottle detectedObjects;
7676
ASSERT_TRUE(iDetector->detect(yarpImgRgb, detectedObjects));

0 commit comments

Comments
 (0)