{"id":19243175,"url":"https://github.com/acecoooool/nldf-pytorch","last_synced_at":"2025-04-21T09:32:48.291Z","repository":{"id":201607402,"uuid":"115866631","full_name":"AceCoooool/NLDF-pytorch","owner":"AceCoooool","description":"An unofficial implementation of non-local deep features for salient object detection","archived":false,"fork":false,"pushed_at":"2019-01-19T07:25:45.000Z","size":351,"stargazers_count":39,"open_issues_count":4,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T12:04:10.781Z","etag":null,"topics":["python","pytorch","salient-object-detection"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AceCoooool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-12-31T14:10:54.000Z","updated_at":"2023-09-19T07:02:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"72e7cc90-a99c-4fb3-8717-77e464383f36","html_url":"https://github.com/AceCoooool/NLDF-pytorch","commit_stats":null,"previous_names":["acecoooool/nldf-pytorch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCoooool%2FNLDF-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCoooool%2FNLDF-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCoooool%2FNLDF-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCoooool%2FNLDF-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AceCoooool","download_url":"https://codeload.github.com/AceCoooool/NLDF-pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250032232,"owners_count":21363799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","pytorch","salient-object-detection"],"created_at":"2024-11-09T17:16:54.237Z","updated_at":"2025-04-21T09:32:47.612Z","avatar_url":"https://github.com/AceCoooool.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NLDF\n[中文说明](./README.zh.md)\n\nAn unofficial implementation of [Non-Local Deep Features for Salient Object Detection](https://sites.google.com/view/zhimingluo/nldf).\n\n\u003cp align=\"center\"\u003e\u003cimg width=\"100%\" src=\"png/example.png\" /\u003e\u003c/p\u003e\n\nThe official Tensorflow version: [NLDF](https://github.com/zhimingluo/NLDF)\n\nSome thing difference:\n\n1. ~~dataset~~\n2. score with one channel, rather than two channels\n3. Dice IOU: boundary version and area version\n\n## Prerequisites\n\n- [Python 3](https://www.continuum.io/downloads)\n- [Pytorch 1.0](http://pytorch.org/)\n- [torchvision](http://pytorch.org/)\n- [visdom](https://github.com/facebookresearch/visdom) (optional for visualization)\n\n## Results\n\nThe information of Loss:\n\n![](./png/loss.png)\n\nPerformance:\n\n| Dataset | max F(paper) | MAE(paper) | max F(here) | MAE(here) |\n| :-----: | :----------: | :--------: | :---------: | :-------: |\n| MSRA-B  |    0.911     |   0.048    |   0.9006    |  0.0592   |\n\nNote: \n\n1. only training 200 epoch, larger epoch may nearly the original paper\n2. This reproduction use area IOU, and original paper use boundary IOU\n3. ~~it's unfairness to this compare. (Different training data, I can not find the dataset use in original paper )~~\n\n## Usage\n\n### 1. Clone the repository\n\n```shell\ngit clone git@github.com:AceCoooool/NLDF-pytorch.git\ncd NLDF-pytorch/\n```\n\n### 2. Download the dataset\n\nNote: the original paper use other datasets.\n\nDownload the [ECSSD](http://www.cse.cuhk.edu.hk/leojia/projects/hsaliency/dataset.html) dataset.  \n\n```shell\nbash download.sh\n```\n\n### 3. Get pre-trained vgg\n\n```bash\ncd tools/\npython extract_vgg.py\ncd ..\n```\n\n### 4. Demo\n\n```shell\npython demo.py --demo_img='your_picture' --trained_model='pre_trained pth' --cuda=True\n```\n\nNote: \n\n1. default choose: download and copy the [pretrained model](https://drive.google.com/file/d/10cnWpqABT6MRdTO0p17hcHornMs6ggQL/view?usp=sharing) to `weights` directory.\n2. a demo picture is in `png/demo.jpg`\n\n### 5. Train\n\n```shell\npython main.py --mode='train' --train_path='you_data' --label_path='you_label' --batch_size=8 --visdom=True --area=True\n```\n\nNote:\n\n1. `--area=True, --boundary=True` area and boundary Dice IOU (default: `--area=True --boundary=False`)\n2. `--val=True` add the validation (but your need to add the `--val_path` and `--val_label`)\n3. `you_data, you_label` means your training data root. (connect to the step 2)\n\n### 6. Test\n\n```shell\npython main.py --mode='test', --test_path='you_data' --test_label='your_label' --batch_size=1 --model='your_trained_model'\n```\n\nNote:\n\n1. use the same evaluation (this is a reproduction from original achievement)\n\n## Bug\n\n1. The boundary Dice IOU may cause `inf`，it is better to use area Dice IOU.\n\nMaybe, it is better to add Batch Normalization. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facecoooool%2Fnldf-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facecoooool%2Fnldf-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facecoooool%2Fnldf-pytorch/lists"}