liuzhian / hf2vad Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
您好,我安装reamme.md的内容,执行了data preprocessing部分,但是我在运行extract_bboxes.py的时候报错了。请问一下这个问题咋解决,或者您可以把pre_process执行完之后生成的文件打包给我吗?谢谢大佬!
C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\mmdet\models\builder.py:51: UserWarning: train_cfg and test_cfg is deprecated, please specify them in model
warnings.warn(
load checkpoint from local path: assets/cascade_rcnn_r101_fpn_1x_coco_20200317-0b6a2fbf.pth
0%| | 0/2550 [00:04<?, ?it/s]
Traceback (most recent call last):
File "D:/workspace/hf2vad-master/hf2vad/pre_process/extract_bboxes.py", line 161, in
obj_bboxes_extraction(dataset_root=os.path.join(args.proj_root, "data"),
File "D:/workspace/hf2vad-master/hf2vad/pre_process/extract_bboxes.py", line 138, in obj_bboxes_extraction
obj_bboxes = getObjBboxes(cur_img, mm_det_model, dataset_name)
File "D:/workspace/hf2vad-master/hf2vad/pre_process/extract_bboxes.py", line 21, in getObjBboxes
result = inference_detector(model, img)
File "D:\workspace\hf2vad-master\hf2vad\pre_process\mmdet_utils.py", line 91, in inference_detector
result = model(return_loss=False, rescale=True, **data)[0]
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\mmcv\runner\fp16_utils.py", line 109, in new_func
return old_func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\mmdet\models\detectors\base.py", line 174, in forward
return self.forward_test(img, img_metas, **kwargs)
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\mmdet\models\detectors\base.py", line 147, in forward_test
return self.simple_test(imgs[0], img_metas[0], **kwargs)
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\mmdet\models\detectors\two_stage.py", line 179, in simple_test
proposal_list = self.rpn_head.simple_test_rpn(x, img_metas)
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\mmdet\models\dense_heads\dense_test_mixins.py", line 130, in simple_test_rpn
proposal_list = self.get_bboxes(*rpn_outs, img_metas=img_metas)
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\mmcv\runner\fp16_utils.py", line 197, in new_func
return old_func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\mmdet\models\dense_heads\base_dense_head.py", line 102, in get_bboxes
results = self._get_bboxes_single(cls_score_list, bbox_pred_list,
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\mmdet\models\dense_heads\rpn_head.py", line 185, in _get_bboxes_single
return self._bbox_post_process(mlvl_scores, mlvl_bbox_preds,
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\mmdet\models\dense_heads\rpn_head.py", line 231, in _bbox_post_process
dets, _ = batched_nms(proposals, scores, ids, cfg.nms)
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\mmcv\utils\config.py", line 48, in getattr
raise ex
AttributeError: 'ConfigDict' object has no attribute 'nms'
Process finished with exit code 1
Hello, thank you very much for opening up the source code. When reading your paper recently, I found that your method can detect whether a single picture is abnormal. But when I read your source code, I found that they are all used for video detection. I now want to use only the reconstruction part to detect whether a single image is abnormal. There is no need to extract box, flow and other preprocessing operations, just like you deal with the Minist data set in your paper, so I would like to ask you to provide the code for detecting the Minist data set?
您好,十分感谢您开源了源代码,最近在拜读您的论文时,发现您的方法可以检测单张图片是否异常。但是我阅读您的源代码时,发现都是用于用于视频检测的。我现在想只使用重建部分检测单张图片是否异常,不需要提取box、flow等预处理操作,就像您在论文里处理Minist数据集那样,因此我想问您提供了检测Minist数据集的代码了吗?
When I try to run the command
$ python extract_flows.py --proj_root=<path/to/project_root> --dataset_name=ped2 --mode=train
It is work but I didn't see anything about the flow in dataset so I just want to know what happen it is?
Hi,
Thank you for your contribution and for providing the code!
Unfortunately I am not able to reproduce the results with the model pretrained on the ShanghaiTech dataset. I have performed all the pre-processing steps as you have clearly explained here and used the same pre-trained cascade RCNN and Flownet2 weights.
Could you provide some information about how you extracted frames from the original videos in the training dataset? I have done it in the following way:
For each of the videos, I created a folder named as the base name of the file, where I extracted the frames using ffmpeg. For example, for the video 01_001.avi
I created a folder named 01_001
and I extracted the frames using the command ffmpeg -r 1 -i 01_001.avi -r 1 -start_number 0 "01_001/%03d.jpg"
. As a result, the training folder is organized in the same way as the testing folder.
Many thanks in advance.
Hello, I am running Python extract_ bboxes. py --proj_ root=<path/to/project_ root> --dataset_ In the code name=ped2 --mode=train, I found that the length of the dataset I got was 0. Why there was no data.
(你好,请问我在运行python extract_bboxes.py --proj_root=<path/to/project_root> --dataset_name=ped2 --mode=train这一代码时发现我得到的dataset的长度为0没有数据是什么原因。)
The problems are as follows
(出现的问题如下所示)
Run the following command:
python extract_bboxes.py --proj_root=/data1/zhouwx/hf2vad-master/ --dataset_name=ped2 --mode=train
Problem:
Traceback (most recent call last):
File "data/hf2vad-master/extract_bboxes.py", line 161, in
obj_bboxes_extraction(dataset_root=os.path.join(args.proj_root, "data"),
File "/data/hf2vad-master/extract_bboxes.py", line 149, in obj_bboxes_extraction
np.save(os.path.join(os.path.join(dataset_root, dataset_name),
File "<array_function internals>", line 200, in save
File "/data/anaconda3/envs/pytorch1.10/lib/python3.9/site-packages/numpy/lib/npyio.py", line 521, in save
arr = np.asanyarray(arr)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2010,) + inhomogeneous part.
Should I change the npyio.py to "arr = np.asanyarray(arr, dtype=object)" to solve this problem?
i want to konw Test001_gt is a folder(there is amat file or a txt file in it) or a txt file or a mat file?
Thank you!
Hello, I got a problem of donwloading mmdetection pretrain model.
Downloading: "https://open-mmlab.s3.ap-northeast-2.amazonaws.com/mmdetection/v2.0/cascade_rcnn/cascade_rcnn_r101_fpn_1x_coco/cascade_rcnn_r101_fpn_1x_coco_20200317-0b6a2fbf.pth" to /home/tianye/.cache/torch/hub/checkpoints/cascade_rcnn_r101_fpn_1x_coco_20200317-0b6a2fbf.pth
Traceback (most recent call last):
File "", line 1, in
File "/home/tianye/mmdetection/mmdet/apis/inference.py", line 43, in init_detector
checkpoint = load_checkpoint(model, checkpoint, map_location=map_loc)
File "/home/tianye/anaconda3/envs/hf2vad/lib/python3.6/site-packages/mmcv/runner/checkpoint.py", line 513, in load_checkpoint
checkpoint = _load_checkpoint(filename, map_location, logger)
File "/home/tianye/anaconda3/envs/hf2vad/lib/python3.6/site-packages/mmcv/runner/checkpoint.py", line 451, in _load_checkpoint
return CheckpointLoader.load_checkpoint(filename, map_location, logger)
File "/home/tianye/anaconda3/envs/hf2vad/lib/python3.6/site-packages/mmcv/runner/checkpoint.py", line 244, in load_checkpoint
return checkpoint_loader(filename, map_location)
File "/home/tianye/anaconda3/envs/hf2vad/lib/python3.6/site-packages/mmcv/runner/checkpoint.py", line 284, in load_from_http
filename, model_dir=model_dir, map_location=map_location)
File "/home/tianye/anaconda3/envs/hf2vad/lib/python3.6/site-packages/torch/hub.py", line 553, in load_state_dict_from_url
download_url_to_file(url, cached_file, hash_prefix, progress=progress)
File "/home/tianye/anaconda3/envs/hf2vad/lib/python3.6/site-packages/torch/hub.py", line 419, in download_url_to_file
u = urlopen(req)
File "/home/tianye/anaconda3/envs/hf2vad/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/home/tianye/anaconda3/envs/hf2vad/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/home/tianye/anaconda3/envs/hf2vad/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/home/tianye/anaconda3/envs/hf2vad/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/home/tianye/anaconda3/envs/hf2vad/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/home/tianye/anaconda3/envs/hf2vad/lib/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
Would you like to upload the cascade RCNN pretrained weights which your paper used? It could definetely be useful to any other ones who want to train their own ML-MemAE-SC model. Thanks so much~
Can this model run under Windows environment?
For this line:
Line 74 in abfde04
is my following interpretation correct? I am trying to use this implementation in my work.
truth
is ground truth labels with normal frames as 0
and anomaly frames as 1
, preds
has (hopefully) lower value for normal frame and higher value for anomaly frames. pos label=1
because the anomaly is 1
in ground truth labels.
Hi,
Thank you for providing the code!
I follow the instructions to prepare the training and testing dataset, however, only got AUC=81.9% in "avenue".Then I replaced the detection model(cascade_rcnn_r101_fpn_1x_coco_20200317-0b6a2fbf.pth) with "torchvision.models.detection.fasterrcnn_resnet50_fpn", and got AUC=89.7%, may i get your "avenue_bboxes_test.npy" and "avenue_bboxes_train.npy"?
Many thanks in advance.
channelnorm_package和resample2d_package都没有问题
correlation_package安装报错
correlation_cuda.cc(7): fatal error C1083: 无法打开包括文件: “/usr/local/cuda/include/cuda_runtime_api.h”: No such file or directory
error: command 'D:\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe' failed with exit status 2
在网上查询无果之后,问一下大佬怎么解决这个问题?
Hello! Thank you for your excellent work. I'm very interested in your work, but I encounter a problem in the preprocessing stage and can't find the preprocessing weight of cascade RCNN . Can you send a download link or upload this weight?
During data preprocessing, an error occurred while executing the 'install_custom_layers.sh' file. What is the version of cuda and gcc you are using?
I am not able to download the USCD Ped2 dataset from the link provided in data-preprocessing readme file.
If possible can you please share updated link?
Where is the chunked_samples ?
In datasets/dataset.py, the function "Chunked_sample_dataset" obtain a data dict,the keys are "appearance\motion\bbox\pred_frame\sample_id" ,but where are the keys and values?
I strictly follow install.md is installed, but it always reports similar errors:
ImportError: libtorch_cuda_cu.so: cannot open shared object file,
or:
File "../pre_process/flownet_networks/correlation_package/correlation.py", line 4, in
import correlation_cuda
ModuleNotFoundError: No module named 'correlation_cuda'
I don't know what the reason is. Can you answer it, GPU: rtx3090, Ubuntu: 20, CUDA: 11.1, thank you very much!
test_cfg = dict( rpn=dict( nms_across_levels=False, nms_pre=1000, nms_post=1000, max_num=1000, nms_thr=0.7, min_bbox_size=0),
在pre_process/assets/latest_version_cascade_rcnn_r101_fpn_1x.py当中找到如上代码块,加上如下两行,在min_bbox_size的上边加
nms=dict(type='nms', iou_threshold=0.7),
max_per_img=100,
Hi, thanks for presenting your great work, and your dog is very cute.
what is the code license? you have not yet added a license for this repository.
I would appreciate it if you could add it.
Many thanks.
No module named 'resample2d_cuda'? Can you tell me how to solve it?
Running extract_ Flows.py
TypeError: forward() takes 3 positional arguments but 5 were given
May I ask how to solve this problem,thankyou
Hello, author, your work is very good and meaningful. Can you give the visualization related code in the visualization process, such as the visual comparison between reconstruction and prediction, such as Figure 6 and Figure 11, thanks!
I met the problem:
ModuleNotFoundError: No module named 'datasets.dataset'
when running ‘python extract_flows.py --dataset_name=ped2 --mode=train’
Hello,Test001_gt……Test012_gt,this folders are empty?Thank you
No module named 'resample2d_cuda'? Can you help me, thank you
Hi, thanks for presenting your great work.
I have a problem while reproducing the results on ped2 dataset, the AUC never reached 99% as mentioned in the paper. I got 97% after training, and after fine-tuning, AUC decreased to 95%. Also, it seems like the performance couldn't improve after the first epoch in training.
I strictly followed the preprocessing steps and didn't change the configurations you provided. Do you have any suggestions regarding this issue? And also, have you tested the model on ped1 dataset, I wonder if there're any configurations differ from ped2.
Thank you so much.
If it's not an excuse, could you tell me the anomaly performance when I only do Flow Reconstruction in avenue?
In the paper, 86% came out, but the result I ran only came out 75%.
thank you.
Hi,
Thank you for sharing your contribution to anomaly detection. I tried to reproduce the baseline on the Avenue dataset. However, I got 89.06% AUC after retraining on Avenue. I got only 90.3% even with the pre-trained model. In the paper, it is 91.1%. Could you please share what could be a possible cause for this mismatch?
Thanks!
Neelu
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.