Skip to content

Commit

Permalink
modify predict.py
Browse files Browse the repository at this point in the history
modify README.md
  • Loading branch information
yahuiwei123 committed Dec 20, 2023
1 parent 0b90273 commit 14625d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ python train.py --batch_size 8 --step 8 --learning_rate 0.01 --num_epochs 100 -o
``

##### 模型预测

``
python predict.py --image_path './test/img' --step 8 --output_size (128, 128) --output_dir './test/out'
``
#### 模型细节
+ 对模型中的如下模块进行了替换
+ Conv2D $\rightarrow$ LayerWiseConvModule
Expand Down
2 changes: 1 addition & 1 deletion predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
softmax = nn.Softmax(dim=1)
logits = softmax(logits)
mask = torch.argmax(logits, dim=1)
cv2.imwrite(output_dir, mask)
cv2.imwrite(f"{output_dir}/mask.png", mask)


0 comments on commit 14625d9

Please sign in to comment.