Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
440356f
1
Parent(s):
7afa5a1
Remove unnecessary weights.
Browse files- app.py +2 -2
- BiRefNet-DIS-epoch_590.pth → materials/examples/1#Accessories#5#Jewelry#12836147075_09291d1d24_o.jpg +2 -2
- BiRefNet-portrait-TR_P3M_10k-epoch_120.pth → materials/examples/20#Sports#8#Racket#4827171149_3140bffe12_o.jpg +2 -2
- materials/examples/4#Architecture#3#Crack#3551574032_17dd106d31_o.jpg +3 -0
app.py
CHANGED
|
@@ -41,7 +41,7 @@ class ImagePreprocessor():
|
|
| 41 |
|
| 42 |
|
| 43 |
model = BiRefNet(bb_pretrained=False)
|
| 44 |
-
state_dict = ['
|
| 45 |
if os.path.exists(state_dict):
|
| 46 |
birefnet_dict = torch.load(state_dict, map_location="cpu")
|
| 47 |
unwanted_prefix = '_orig_mod.'
|
|
@@ -81,7 +81,7 @@ def predict(image, resolution):
|
|
| 81 |
for image, pred in zip(images, preds):
|
| 82 |
image = image.resize(pred.shape[::-1])
|
| 83 |
pred = np.repeat(np.expand_dims(pred, axis=-1), 3, axis=-1)
|
| 84 |
-
image_preds.append((
|
| 85 |
|
| 86 |
return image, image_preds[0]
|
| 87 |
|
|
|
|
| 41 |
|
| 42 |
|
| 43 |
model = BiRefNet(bb_pretrained=False)
|
| 44 |
+
state_dict = ['BiRefNet-massive-epoch_240.pth'][0]
|
| 45 |
if os.path.exists(state_dict):
|
| 46 |
birefnet_dict = torch.load(state_dict, map_location="cpu")
|
| 47 |
unwanted_prefix = '_orig_mod.'
|
|
|
|
| 81 |
for image, pred in zip(images, preds):
|
| 82 |
image = image.resize(pred.shape[::-1])
|
| 83 |
pred = np.repeat(np.expand_dims(pred, axis=-1), 3, axis=-1)
|
| 84 |
+
image_preds.append((pred * image).astype(np.uint8))
|
| 85 |
|
| 86 |
return image, image_preds[0]
|
| 87 |
|
BiRefNet-DIS-epoch_590.pth → materials/examples/1#Accessories#5#Jewelry#12836147075_09291d1d24_o.jpg
RENAMED
|
File without changes
|
BiRefNet-portrait-TR_P3M_10k-epoch_120.pth → materials/examples/20#Sports#8#Racket#4827171149_3140bffe12_o.jpg
RENAMED
|
File without changes
|
materials/examples/4#Architecture#3#Crack#3551574032_17dd106d31_o.jpg
ADDED
|
Git LFS Details
|