Coder Social home page Coder Social logo

Comments (31)

MarvinTeichmann avatar MarvinTeichmann commented on August 28, 2024 2

An example of a val3.txt and train3.txt can be found in data. Each line of those files contains pathes to two images. The first image is the input image and the second the ground_truth image. Both pathes are seperated with a withe space. The paths are given relative to the location of the .txt file.

Hope this helps!

from kittiseg.

obendidi avatar obendidi commented on August 28, 2024 2

I believe you should comment the line 127 in the script train.py , that's the line responsible for downloading the dataset, after commenting it it will just use directly the path's that you provided on the hypes for your own data

from kittiseg.

Steven-N-Hart avatar Steven-N-Hart commented on August 28, 2024 1

OK. I think I understand a bit more now, and will elaborate here so that when I forget, I can just come back :).
The train3.txt file is a space-separated file with column 1 being the path to an image and column 2 to a mask. The mask file is a re-colored version of the image in column 1, with colors indicated by what the user inputs into KittiSeg.json in the data section:

"road_color" : [255,0,255],
"background_color" : [255,0,0],

train3.txt is a list of image pairs for training
val3.txt is a list of image pairs for validation

So, if one wants to train KittiSeg on their own data, they must create the image masks on their own images, and remove the references to the road data.

Does this sound about right?

from kittiseg.

obendidi avatar obendidi commented on August 28, 2024 1

yes it's the 123 rd line ,sorry about that , I added some lines in my script that I forgot about , if you made your input configuration correctly , it should work now

from kittiseg.

obendidi avatar obendidi commented on August 28, 2024 1

nope , commentjson worked fine , I'm running it on python2.7 , maybe that's why
I don't have the code right now , (on another computer , so till monday , if you would still need it )

when you changed the masks to be in RGB , did you make sure the 2 colors that are in in RGB mask are the ones you provided in the hypes ? aside from that I cannot think of anything else ...

from kittiseg.

kyoseoksong avatar kyoseoksong commented on August 28, 2024

I would like to know how I can structure my own datasets, too.
Can you elaborate on it, please?

from kittiseg.

MarvinTeichmann avatar MarvinTeichmann commented on August 28, 2024

That sounds about right. I would usually call the second image ground_truth or label.

from kittiseg.

MarvinTeichmann avatar MarvinTeichmann commented on August 28, 2024

I have created input.md, which is supposed to describing the input format in detail. Feel free to modify this file or add details if you feel this is needed for better understandability. As author it is sometime hard to see what aspects are obvious ;).

from kittiseg.

MarvinTeichmann avatar MarvinTeichmann commented on August 28, 2024

Providing input.md should also fix this issue :).

from kittiseg.

kyoseoksong avatar kyoseoksong commented on August 28, 2024

from kittiseg.

MarvinTeichmann avatar MarvinTeichmann commented on August 28, 2024

Hi kyoseoksong,

are you doing classification or segmentation? The code is build for segmentation, which is basically "classification per pixel". If you are solving segmentation, you can use the code as given, including kitti_seg_input.py and kitti_eval.py. Just make sure, that you set road_color and background_color correctly.

kitti_eval.py will compute the scores of the kitti benchmark (maxF1 and averagePrecision). If you have your own dataset which comes with different metrics you will eventually want to implement you own evaluation code at some point. But this does not influence training, so I would suggest starting of with this code and modify the evaluation once it is running fine.

If you are actually doing classification, you need to use an input producer and evaluation module for classification. You can find examples for both in my KittiClass project.

from kittiseg.

kyoseoksong avatar kyoseoksong commented on August 28, 2024

from kittiseg.

MarvinTeichmann avatar MarvinTeichmann commented on August 28, 2024

Happy to help. Don't forget to cite one of my papers, if you get any chance ;).

Since f7fdb24, using greyscale images work out-of-the box. The images will be converted to RGB upon load, so a black pixel has value [0,0,0], white [255,255,255] and some light grey can be [200, 200, 200].

from kittiseg.

kyoseoksong avatar kyoseoksong commented on August 28, 2024

from kittiseg.

MarvinTeichmann avatar MarvinTeichmann commented on August 28, 2024

Hi Andy,

commit 0e8d548 moved it to docu/inputs.md.

Marvin

from kittiseg.

kyoseoksong avatar kyoseoksong commented on August 28, 2024

from kittiseg.

lemhell avatar lemhell commented on August 28, 2024

Hello, @MarvinTeichmann
I want to train this model on my own dataset.
I created the necessary files train_file and val_file, specified road_color and background_color.
But when I call tv-train --hypes myHype.json, the output is:
ERROR Data URL for Kitti Data not provided.
ERROR Please visit: http://www.cvlibs.net/download.php?file=data_road.zip
ERROR and request Kitti Download link.
ERROR Enter URL in hypes/kittiSeg.json

I'm downloading this data right now (got link by e-mail and started tv-train again), but I don't see, why do I need it to train on my own data, or maybe I just did something wrong. Can you help me?
Thank you in advance.

from kittiseg.

lemhell avatar lemhell commented on August 28, 2024

Thank you, for your response, @Bendidi @MarvinTeichmann
Are you sure that I should comment this line?
First of all, I'm using tv-train, not train.py (but maybe tv-train calls train.py)
Secondly, line 127 is train.do_training(hypes), looks like it is connected to the training, not to the download process. Haven't tested this yet, though.
EDIT: I guess, I should comment the 123rd line: train.maybe_download_and_extract(hypes)
Will check it now

from kittiseg.

lemhell avatar lemhell commented on August 28, 2024

@Bendidi Thank you for the clarification.
All I did:
created my train.txt and val.txt with the following structure:
path_to_img/img1.jpg path_to_mask/mask1.png
And so on.
Then, I copied the hype file and changed paths in it for train_file and val_file and changed road_color and background_color accordingly.
Then, I commented line 123 and changed one import from commentjson to json (It was returning the same error, as Issue 28).
After that, I'm starting this:
python train.py --hypes hypes/MyHype.json
And get the same error, as in Issue 35

Have you done something differently in order to train this model on your custom data?
Also, my images are 3D and masks are 2D, but I've seen somewhere in the issues that this should work just fine.

from kittiseg.

obendidi avatar obendidi commented on August 28, 2024

I've done something different , I completely changed the input script , so that I just have to give it a path , and it loads the images directly without the need of train.txt and val.txt , I also added a line to resize images to the same shape as kitti images , the images and the masks should be 'RGB' I believe (I don't know what you mean by 3D and 2D )
for 2 colors I got it working just fine with this setup , and the result was satisfying for the most part , hope it helps you

from kittiseg.

lemhell avatar lemhell commented on August 28, 2024

By the input script you mean "input_file" field inside the hypes json? By default it's this one: "../inputs/kitti_seg_input.py"
If I understand you correctly, you did not changed anything beside that "input_file" script.
By 3D I meant RGB and by 2D - grayscale images.

from kittiseg.

obendidi avatar obendidi commented on August 28, 2024

yes it's the kitti_seg_input.py script ,

The problem might be because you use grayscale images for the mask , and the image reader reads them in RGB mode as seen in line 123 of the input file and so it won't find the colors that you provided in the hypes file , to create the training variables , lines 157 and 158

from kittiseg.

lemhell avatar lemhell commented on August 28, 2024

I changed the masks to be in RGB as well, but the problem persists: ValueError: No variables provided.
Do you have any code so I could compare?
Also, did you have the problem with inability to import dump from commentjson?

from kittiseg.

lemhell avatar lemhell commented on August 28, 2024

@Bendidi
Thank you for your answers.
I installed everything for Python 2.7 and it started to work, even with commentjson.

from kittiseg.

lemhell avatar lemhell commented on August 28, 2024

I started training and MaxF1 started near 17, now it is near 26 after 4500 steps (out of 12000) and sometimes jumps around. Is it ok or should I do something?
Also, there is a parameter called weight_loss and it is always the same: 3.62.

from kittiseg.

KKayak avatar KKayak commented on August 28, 2024

@lemhell how to comment line 123

from kittiseg.

lemhell avatar lemhell commented on August 28, 2024

@1464256670
If I recall correctly, I downloaded this repository and commented the problematic line (123) in the train.py script (using # at the start of this line).
However, it did not resolve the problem and I switched to Python 2.7. After that, the script started to work.

from kittiseg.

KKayak avatar KKayak commented on August 28, 2024

@lemhell by the way,thanks for your replyment,another question:to train my own data,all what i did is creating my train.txt and val.txt ,is that enough ,anything else to do?

from kittiseg.

KKayak avatar KKayak commented on August 28, 2024

@lemhell is only running train.py enough,any other .py should i run?

from kittiseg.

lemhell avatar lemhell commented on August 28, 2024

@1464256670
You can probably find some info here.

from kittiseg.

YongKun-Liu avatar YongKun-Liu commented on August 28, 2024

objective function also need to change

from kittiseg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.