sunshangquan commited on
Commit
5fbced4
·
1 Parent(s): 7ab2cfa
Files changed (3) hide show
  1. basicsr/models/archs/histoformer_arch.py +3 -3
  2. demo.py +7 -10
  3. git.bash +1 -1
basicsr/models/archs/histoformer_arch.py CHANGED
@@ -271,11 +271,11 @@ class Histoformer(nn.Module):
271
  def __init__(self,
272
  inp_channels=3,
273
  out_channels=3,
274
- dim = 48,
275
- num_blocks = [4,6,6,8],
276
  num_refinement_blocks = 4,
277
  heads = [1,2,4,8],
278
- ffn_expansion_factor = 2.66,
279
  bias = False,
280
  LayerNorm_type = 'WithBias', ## Other option 'BiasFree'
281
  dual_pixel_task = False ## True for dual-pixel defocus deblurring only. Also set inp_channels=6
 
271
  def __init__(self,
272
  inp_channels=3,
273
  out_channels=3,
274
+ dim = 36,
275
+ num_blocks = [4,4,6,8],
276
  num_refinement_blocks = 4,
277
  heads = [1,2,4,8],
278
+ ffn_expansion_factor = 2.667,
279
  bias = False,
280
  LayerNorm_type = 'WithBias', ## Other option 'BiasFree'
281
  dual_pixel_task = False ## True for dual-pixel defocus deblurring only. Also set inp_channels=6
demo.py CHANGED
@@ -1,18 +1,15 @@
1
- from basicsr.model.image_restoration_model import ImageCleanModel
2
- <<<<<<< HEAD
3
- from huggingface_hub import PyTorchModelHubMixin
4
- =======
5
- >>>>>>> 0c10de556292aefe29d7af74311340a7eb844834
6
 
7
  # define model
8
- model = ImageCleanModel(...)
9
 
10
  # equip with weights
11
- filepath = hf_hub_download(repo_id="sunsean/Histoformer", filename="net_g_best.pth")
12
- model.load_state_dict(filepath, map_location="cpu")
13
 
14
  # push to hub
15
- model.push_to_hub("sunsean/Histoformer-best")
16
 
17
  # reload
18
- model = ImageCleanModel.from_pretrained("sunsean/Histoformer-best")
 
1
+ from basicsr.models.archs.histoformer_arch import Histoformer
2
+ # from huggingface_hub import PyTorchModelHubMixin
 
 
 
3
 
4
  # define model
5
+ model = Histoformer()
6
 
7
  # equip with weights
8
+ filepath = hf_hub_download(repo_id="sunsean/Histoformer", filename="Allweather/pretrained_models/net_g_real.pth")
9
+ model.load_state_dict(filepath, map_location="gpu")
10
 
11
  # push to hub
12
+ model.push_to_hub("sunsean/Histoformer-real")
13
 
14
  # reload
15
+ model = ImageCleanModel.from_pretrained("sunsean/Histoformer-real")
git.bash CHANGED
@@ -1,3 +1,3 @@
1
  git add .
2
- git commit -m "commit from $USER"
3
  git push
 
1
  git add .
2
+ git commit -m "c"
3
  git push