seominseok0429 / Real-world-Anomaly-Detection-in-Surveillance-Videos-pytorch

Real-world Anomaly Detection in Surveillance Videos- pytorch Re-implementation
102 stars 24 forks source link

loss 관련 질문입니다. #12

Closed HyunjungPark closed 2 years ago

HyunjungPark commented 2 years ago

안녕하세요! 코드 이해하기 쉽게 짜주셔서 도움을 많이 받고 있습니다. 감사합니다~! loss 코드 중에 anomaly_index/normal_index를 randperm으로 한 부분은 잘 이해가 되지 않는데, 혹시 이렇게 해야하는 이유가 있나요..?

seominseok0429 commented 2 years ago

데이터 어그멘테이션 이라고 생각하시면 될것 같습니다.

예를들어 1~30 개을 가져 오는 것보다, 랜덤 하게 30개를 가져오는게 성능이 더 좋습니다.

Chuttyboy commented 1 year ago

You can think of it as data augmentation.

For example, it is better to get 30 randomly than to bring 1 to 30.

@HyunjungPark @seominseok0429

After training how to test video with the trained model ? can you please help me

Thanks

seominseok0429 commented 1 year ago

@Chuttyboy Added visualization code. Check out the link below.

https://github.com/seominseok0429/Real-world-Anomaly-Detection-in-Surveillance-Videos-pytorch/blob/main/vis.py

Thanks

Chuttyboy commented 1 year ago

@Chuttyboy Added visualization code. Check out the link below.

https://github.com/seominseok0429/Real-world-Anomaly-Detection-in-Surveillance-Videos-pytorch/blob/main/vis.py

Thanks

@seominseok0429 @HyunjungPark

Thanks for adding visualization code. How to save models after training

checkpoint = torch.load('./weight/RGB_Kinetics_16f.pth')
model.load_state_dict(checkpoint['state_dict'])
checkpoint = torch.load('./weight/ckpt.pth')
classifier.load_state_dict(checkpoint['net'])

can you please explain what happened here and how to download RGB_Kinetics_16f.pth

Thanks

seominseok0429 commented 1 year ago

This is the modified download link. https://drive.google.com/file/d/1xYsBiCSmXjE0BwoiH_Bcm4AWaA1pESHF/view?usp=sharing