AlchemyEmperor / SIAVC

Semi-Supervised Framework for Industrial Accident Video Classification
3 stars 0 forks source link

How to use your own dataset #1

Open srssrs0618 opened 3 weeks ago

srssrs0618 commented 3 weeks ago

I want to replace my own dataset in other fields. What adjustments should I make?

AlchemyEmperor commented 3 weeks ago

If you would like to use your own dataset, you can organize your data according to the structure provided on GitHub, dividing each video into training and testing sets in .mp4 or .pkl format. Then, set the desired classification categories on line 67 of SIAVC.py, and set the resolution for inputting the model on line 140. To start training, simply change the name of your own dataset on lines 233 to 236 of the code.

srssrs0618 commented 1 week ago

What graphics card did you use for training, and how long did the training take?

AlchemyEmperor commented 1 week ago

I used 7 NVIDIA 3090 GPUs for distributed training, and the current code uses the ViT/B-16 backbone. Training typically takes a few days. If memory is constrained, ResNet3D can be used as the backbone for faster training, although the baseline performance might decrease.

srssrs0618 commented 6 days ago

1 How to change the backbone? 2 Do I need to modify the name of line 233 every time I train a category? 3 I don't understand what line 140 means to set the resolution of the input model? 4 In addition to Python 3.9, do I need to install any other environment dependencies when using PyTorch 2.0.1? Thank you for your patient answer.

AlchemyEmperor commented 6 days ago

Answer 1: Some commonly used 3D models are placed in ./all_model/models, and you can call them using the generate_model function in each model's .py file. Just mimic the model definition from line 167 of SIAVC.py.

Answer 2: When changing the dataset, you only need to modify the dataset names from lines 233 to 236; the code can read all categories from that path (samples of one category are stored in one folder, so five categories require five folders).

Answer 3: In line 140 of SIAVC.py, you can manually set the dataloader to load the resolution of the videos, ensuring that your machine has enough GPU memory to load this data. If your GPU memory is insufficient, reduce it; otherwise, you can increase it. Compressing the video resolution may have some impact on performance.

Answer 4: I forgot the specific environments needed, but you can determine the required dependencies by debugging SIAVC.py; just repeat the process a few times.