Solved

Machine learning/computer vision - XML (knowledge) generation problem


Hi FME folks,

My first post so go easy on me please :)

We use FME at work for various geo-spatial projects and I've been asked to look into it's C.Vision capabilities. Previously I had a crack at anaconda and some GPU accelerated approaches but the amount of back-end stuff necessary to get started go a little too involved.

I've gone through your video tute @dmitribagh as well as all the workspaces provided and with some solid hrs. of practice I managed to get all of them working. I am somewhat of an an FME newb with less then 50hrs. of usage at a rough guess.

I'm trying to build a model for recognizing houses (roofs) in aerial photography. I've managed to create auto annotations using some footprint data which we have.

Idea being that I need a "clean" image of a single house rather than a house surrounded by other houses, and annotations being rectangles sort of forces you to improvise.

 

I have a bunch of negatives of empty lots which I manually created ...

 

... and these are some positives that were auto generated with FME for my initial anaconda tests.

 

My issue is that I can get the entire process to work, generate the VEC , background TXT and annotations BUT when I output the XML / knowledge files they are always 17kb in size and all have the same content no matter which model I hook up / train.

 

So I know I'm doing something wrong somewhere and hopefully someone here can point me in the right direction.

 

Cheers.

icon

Best answer by dmitribagh 11 May 2020, 20:34

View original

3 replies

Userlevel 2
Badge +11

Hi @adklys,

this is weird indeed, I am not sure what is going on, but certainly want to help you figuring it out. First of all, the OpenCV transformers coming with FME as a package are just pretty light wrappers around the OpenCV code, so the issues existing in OpenCV will also be present in the transformers. One of the problems I had to deal with, was the need to use relative path practically everywhere except the RasterObjectDetector (which is the only standard transformer in the RasterObject... family). So please make sure you have relative paths in RasterObjectDetectorSamplePreparer and RasterObjectDetectionModelTrainer (this one can have an absolute path to the temp folder).

 

Somehow, when I used absolute paths, my xml was created in the package install folder, not where I specified it.

 

 

Please also make sure you clean the temp folder between the training sessions, but keep its contents if the training failed and you want to restart it from the point where it failed (yes, it's all a bit complicated).

 

Finally, if you could send us your log file and the workspaces, that might help to narrow down what is happening.

 

 

Feel free to send me an email to

 

 

Dmitri
Badge +2

Hi @adklys,

this is weird indeed, I am not sure what is going on, but certainly want to help you figuring it out. First of all, the OpenCV transformers coming with FME as a package are just pretty light wrappers around the OpenCV code, so the issues existing in OpenCV will also be present in the transformers. One of the problems I had to deal with, was the need to use relative path practically everywhere except the RasterObjectDetector (which is the only standard transformer in the RasterObject... family). So please make sure you have relative paths in RasterObjectDetectorSamplePreparer and RasterObjectDetectionModelTrainer (this one can have an absolute path to the temp folder).

 

Somehow, when I used absolute paths, my xml was created in the package install folder, not where I specified it.

 

 

Please also make sure you clean the temp folder between the training sessions, but keep its contents if the training failed and you want to restart it from the point where it failed (yes, it's all a bit complicated).

 

Finally, if you could send us your log file and the workspaces, that might help to narrow down what is happening.

 

 

Feel free to send me an email to

 

 

Dmitri

I downloaded 4.3.0 from the OpenCV site and had a lot more success when using the three transformers. I'm not sure what version is included with the 2020.1.0.0 (20200305 - Build 20510 - WIN64) release but replacing the plugin seems to help quite a bit. I was able to go through the stop sign example with about 20 positive samples without a single error and use any image on the internet to get a box around a sign vs. the original version included that crashed repeatedly.

Hi @adklys,

this is weird indeed, I am not sure what is going on, but certainly want to help you figuring it out. First of all, the OpenCV transformers coming with FME as a package are just pretty light wrappers around the OpenCV code, so the issues existing in OpenCV will also be present in the transformers. One of the problems I had to deal with, was the need to use relative path practically everywhere except the RasterObjectDetector (which is the only standard transformer in the RasterObject... family). So please make sure you have relative paths in RasterObjectDetectorSamplePreparer and RasterObjectDetectionModelTrainer (this one can have an absolute path to the temp folder).

 

Somehow, when I used absolute paths, my xml was created in the package install folder, not where I specified it.

 

 

Please also make sure you clean the temp folder between the training sessions, but keep its contents if the training failed and you want to restart it from the point where it failed (yes, it's all a bit complicated).

 

Finally, if you could send us your log file and the workspaces, that might help to narrow down what is happening.

 

 

Feel free to send me an email to

 

 

Dmitri

Hi Dmitri & Joshua,

I was in the middle of composing a follow up, complete with workspaces and subset of my data, when I solved this riddle Sunday afternoon :)

Indeed it was the temp folder Dmitri, where it appears a progress of the solution is kept.

I never realised I had to empty it between runs. Now that I've got that figured it seems I'm all good to go.

 

Many thanks for your hints and follow up gents, it's greatly appreciated.

 

I'll definitely try the latest OpenCV as well.

 

 

Reply