-
Notifications
You must be signed in to change notification settings - Fork 836
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
How to train Custom Dataset #220
Comments
@L1aoXingyu I don't understand clearly your documentation for custom dataset. I've tried your way but got below error:
And this is my product_dataset.py file in fastreid folder:
Although I had removed
And in the each child folder, has the structure as below (ex: train/data_38/):
In each above number folder has some images. |
I've solve the problems with my datasets. And the key was that, |
@AnhPC03 Yes, you are right! It doesn't matter how your data structure is. The key idea is preparing the |
@L1aoXingyu What is the purpose of formatting the train |
@addisonklinke When combining two or more datasets to train, the integers will be confusing because 0 will be different ids in different datasets. |
@L1aoXingyu I see, that makes sense. Thank you for the clarification. Another question I had is whether there are guidelines for splitting a dataset into train, query, and gallery subsets. Obviously, we want the identity IDs in train to be mutually exclusive with those in query and gallery in order to have an unbiased evaluation. However, when constructing query and gallery I am wondering...
|
Hello, I train the model on my own dataset, but I will be stuck in the process of data loading during training, that is, here, why is this?
|
hi,您好,我是否可以把自己的数据集图片重命名成market1501的格式放进market数据集文件夹中,使用market的配置直接训练? |
@vicwer 这种方式也可以,但是还是推荐使用上面写的自定义数据集配置。 |
@L1aoXingyu I want to train your fast-reid repo for classification. And my dataset has following structure:
I had written dataloader as below:
I had use train dataset as role of query dataset, and val as role of test dataset. But when i was training, i got the error:
But when i printed, tensor a equaled tensor b in shape everytime. |
按照你上面流程里配置完成之后,config.yml文件中的name 和 继承的MyOwnDataset类中的参数 ”datasetname“ 是不是要统一? |
配置文件里面的数据集名字需要和自己定义的数据集名字匹配,比如上面的例子,在 config 里面需要写成 "SuperClassDataset" |
Hello @L1aoXingyu. First of all, thank you for you amazing work! If I understand correctly, I can train FastReID to re-identify any custom object I want right? In my case, I need to be able to re-identify a certain fruit. So I just need a dataset containing images of that fruit, right? Thank you for your contribution! |
Yes, if you want to train a model for identifying different fruits, you can collect a dataset with different kinds of fruits and train on it. |
同样遇到这个bug了 |
@AnhPC03 Did you solved this issue? It would be helpful for me if you can guide me through the error |
This issue is stale because it has been open for 30 days with no activity. |
@AnhPC03 can you please tell us how did you solved this issue?| |
@shreejalt @akashAD98 Did you guys get this error |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Hey @AnhPC03, I know its been a few years but I am trying to build a classifer like you, but I can't get it working. Did you ever run into an issue where the trainer stalls forever without erroring out? |
你好,请问您解决了这个问题吗?,我现在也是训练不报错,但是卡死不运行状态 |
Hi, how did you name the images ? |
This guide explains how to train your own custom dataset with fastreid's data loaders.
Before You Start
Following Getting Started to setup the environment and install requirements.txt dependencies.
Train on Custom Dataset
Register your dataset (i.e., tell fastreid how to obtain your dataset).
To let fastreid know how to obtain a dataset named "my_dataset", users need to implement a
Class
that inheritsfastreid.data.datasets.bases.ImageDataset
:Here, the snippet associates a dataset named "MyOwnDataset" with a class that processes train set, query set and gallery set and then pass to the baseClass. Then add a decorator to this class for registration.
The class can do arbitrary things and should generate train list:
list(str, str, str)
, query list:list(str, int, int)
and gallery list:list(str, int, int)
as below.You can also pass an empty train_list to generate a "Testset" only with
super().__init__([], query, gallery)
.Notice: query and gallery sets could have the same camera views, but for each individual query identity, his/her gallery samples from the same camera are excluded. So if your dataset has no camera annotations, you can set all query identities camera number to
0
and all gallery identities camera number to1
, then you can get the testing results.Import your dataset.
Aftre registering your own dataset, you need to import it in
train_net.py
to make it effective.The text was updated successfully, but these errors were encountered: