Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request MarvinTeichmann#7 from MartinThoma/master
Browse files Browse the repository at this point in the history
Add error message if npy is not present; make test_*.py executable
  • Loading branch information
MarvinTeichmann authored Jul 8, 2016
2 parents e540f3b + b7bd9cd commit d677f9e
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# tensorflow-fcn
This is a Tensorflow implementation of [Fully Convolutional Networks](http://arxiv.org/abs/1411.4038) in Tensorflow. The network can be applied directly or finetuned using tensorflow training code.

Deconvolution Layers are initialized as bilinear upsampling. Conv and FCN layer weights using VGG weights. Numpy load is used to read VGG weights. No Caffe or Kaffe-Tensorflow is required to run this. The .npy file for <a href="https://dl.dropboxusercontent.com/u/50333326/vgg16.npy">VGG16</a> however need to be downloaded before using this needwork.
Deconvolution Layers are initialized as bilinear upsampling. Conv and FCN layer weights using VGG weights. Numpy load is used to read VGG weights. No Caffe or Caffe-Tensorflow is required to run this. <b>The .npy file for <a href="https://dl.dropboxusercontent.com/u/50333326/vgg16.npy">VGG16</a> however need to be downloaded before using this needwork.</b>

No Pascal VOC finetuning was applied to the weights. The model is meant to be finetuned on your own data. The model can be applied to an image directly (see `test_fcn32_vgg.py`) but the result will be rather coarse.

Expand Down
7 changes: 6 additions & 1 deletion fcn16_vgg.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ def __init__(self, vgg16_npy_path=None):
path = os.path.abspath(os.path.join(path, os.pardir))
# print path
path = os.path.join(path, "vgg16.npy")
print(path)
vgg16_npy_path = path
logging.info("Load npy file from '%s'.", vgg16_npy_path)
if not os.path.isfile(vgg16_npy_path):
logging.error(("File '%s' not found. Download it from "
"https://dl.dropboxusercontent.com/u/"
"50333326/vgg16.npy"), vgg16_npy_path)
sys.exit(1)

self.data_dict = np.load(vgg16_npy_path, encoding='latin1').item()
self.wd = 5e-4
Expand Down
7 changes: 6 additions & 1 deletion fcn32_vgg.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ def __init__(self, vgg16_npy_path=None):
path = os.path.abspath(os.path.join(path, os.pardir))
# print path
path = os.path.join(path, "vgg16.npy")
print(path)
vgg16_npy_path = path
logging.info("Load npy file from '%s'.", vgg16_npy_path)
if not os.path.isfile(vgg16_npy_path):
logging.error(("File '%s' not found. Download it from "
"https://dl.dropboxusercontent.com/u/"
"50333326/vgg16.npy"), vgg16_npy_path)
sys.exit(1)

self.data_dict = np.load(vgg16_npy_path, encoding='latin1').item()
self.wd = 5e-4
Expand Down
7 changes: 6 additions & 1 deletion fcn8_vgg.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ def __init__(self, vgg16_npy_path=None):
path = os.path.abspath(os.path.join(path, os.pardir))
# print path
path = os.path.join(path, "vgg16.npy")
print(path)
vgg16_npy_path = path
logging.info("Load npy file from '%s'.", vgg16_npy_path)
if not os.path.isfile(vgg16_npy_path):
logging.error(("File '%s' not found. Download it from "
"https://dl.dropboxusercontent.com/u/"
"50333326/vgg16.npy"), vgg16_npy_path)
sys.exit(1)

self.data_dict = np.load(vgg16_npy_path, encoding='latin1').item()
self.wd = 5e-4
Expand Down
2 changes: 2 additions & 0 deletions test_fcn16_vgg.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

import skimage
import skimage.io
import skimage.transform
Expand Down
2 changes: 2 additions & 0 deletions test_fcn32_vgg.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

import skimage
import skimage.io
import skimage.transform
Expand Down
2 changes: 2 additions & 0 deletions test_fcn8_vgg.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

import skimage
import skimage.io
import skimage.transform
Expand Down

0 comments on commit d677f9e

Please sign in to comment.