Skip to content

Commit

Permalink
- Update weights and results links.
Browse files Browse the repository at this point in the history
- Fixed some bugs.
lartpang committed Mar 5, 2022
1 parent d21a3fc commit 67d401b
Showing 3 changed files with 25 additions and 16 deletions.
14 changes: 11 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -7,9 +7,12 @@

## Changelog

* 2022-03-04:
- Initialize the repository.
- Add the model and configuration file for SOD.
* 2022-03-05:
- Update weights and results links.
- Fixed some bugs.
* 2022-03-04:
- Initialize the repository.
- Add the model and configuration file for SOD.

## Usage

@@ -49,6 +52,11 @@ If you want to launch multiple commands, you can use it like this:

### Testing

| Task | Weights | Results |
|------|-----------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| COD | [GitHub Release Link](https://github.com/lartpang/ZoomNet/releases/download/v0.0.1/cod_zoomnet_r50_bs8_e40_2022-03-04.pth) | [GitHub Release Link](https://github.com/lartpang/ZoomNet/releases/download/v0.0.1/CVPR-2022-ZoomNet-COD.zip) |
| SOD | [GitHub Release Link](https://github.com/lartpang/ZoomNet/releases/download/v0.0.1/sod_zoomnet_r50_bs22_e50_2022-03-04_fixed.pth) | [GitHub Release Link](https://github.com/lartpang/ZoomNet/releases/download/v0.0.1/CVPR-2022-ZoomNet-SOD.zip) |

For ease of use, we create a `test.py` script and a use case in the form of a shell script `test.sh`.

```shell
7 changes: 4 additions & 3 deletions test.py
Original file line number Diff line number Diff line change
@@ -96,10 +96,11 @@ def test_once(
if clip_range is not None:
pred = ops.clip_to_normalize(pred, clip_range=clip_range)

if to_minmax:
pred = ops.minmax(pred)

if save_path: # 这里的save_path包含了数据集名字
ops.save_array_as_image(
data_array=pred, save_name=os.path.basename(mask_path), save_dir=save_path, to_minmax=to_minmax
)
ops.save_array_as_image(data_array=pred, save_name=os.path.basename(mask_path), save_dir=save_path)

pred = (pred * 255).astype(np.uint8)
cal_total_seg_metrics.step(pred, mask_array, mask_path)
20 changes: 10 additions & 10 deletions test.sh
Original file line number Diff line number Diff line change
@@ -8,15 +8,15 @@ export CUDA_VISIBLE_DEVICES="$1"
echo 'Excute the script on GPU: ' "$1"

echo 'For COD'
python test.py --model-name ZoomNet --batch-size 20 \
--config ./configs/zoomnet/cod_zoomnet.py \
--load-from output/ForSharing/cod_zoomnet_r50_bs8_e40_2022-03-04.pth \
--save-path output/ForSharing/COD_Results \
--minmax-results
python test.py --config ./configs/zoomnet/cod_zoomnet.py \
--model-name ZoomNet \
--batch-size 22 \
--load-from ./output/ForSharing/cod_zoomnet_r50_bs8_e40_2022-03-04.pth \
--save-path ./output/ForSharing/COD_Results

echo 'For SOD'
python test.py --model-name ZoomNet --batch-size 20 \
--config ./configs/zoomnet/sod_zoomnet.py \
--load-from output/ForSharing/sod_zoomnet_r50_bs22_e50_2022-03-04_fixed.pth \
--save-path output/ForSharing/SOD_Results \
--minmax-results
python test.py --config ./configs/zoomnet/sod_zoomnet.py \
--model-name ZoomNet \
--batch-size 22 \
--load-from ./output/ForSharing/sod_zoomnet_r50_bs22_e50_2022-03-04_fixed.pth \
--save-path ./output/ForSharing/SOD_Results

0 comments on commit 67d401b

Please sign in to comment.