"git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "e0319bd78d834675a06fb2e9e2673efe29dfa722"
Unverified Commit 19e60dc3 authored by BasiaFusinska's avatar BasiaFusinska Committed by GitHub
Browse files

Python 2 -> 3 migration (#8525)

* Changed DELF installation instructions to be Python3 preferred

* Changed DELF landmark detection instructions to be Python3 preferred

* Changed DELF extraction and matching instructions to be Python3 preferred

* Changed DELF detect-to-retrieve instructions to be Python3 preferred

* Changed DELF training instructions to be Python3 preferred

* Added Python3 badge to DELF README
parent e81d423d
...@@ -44,7 +44,7 @@ threshold of 0.8, and produce visualizations. ...@@ -44,7 +44,7 @@ threshold of 0.8, and produce visualizations.
```bash ```bash
# From tensorflow/models/research/delf/delf/python/examples/ # From tensorflow/models/research/delf/delf/python/examples/
python extract_boxes.py \ python3 extract_boxes.py \
--detector_path parameters/d2r_frcnn_20190411 \ --detector_path parameters/d2r_frcnn_20190411 \
--detector_thresh 0.8 \ --detector_thresh 0.8 \
--list_images_path list_images_detector.txt \ --list_images_path list_images_detector.txt \
......
...@@ -44,7 +44,7 @@ features for the images `hertford_000056.jpg` and `oxford_000317.jpg`: ...@@ -44,7 +44,7 @@ features for the images `hertford_000056.jpg` and `oxford_000317.jpg`:
```bash ```bash
# From tensorflow/models/research/delf/delf/python/examples/ # From tensorflow/models/research/delf/delf/python/examples/
python extract_features.py \ python3 extract_features.py \
--config_path delf_config_example.pbtxt \ --config_path delf_config_example.pbtxt \
--list_images_path list_images.txt \ --list_images_path list_images.txt \
--output_dir data/oxford5k_features --output_dir data/oxford5k_features
...@@ -56,7 +56,7 @@ After feature extraction, run this command to perform feature matching between ...@@ -56,7 +56,7 @@ After feature extraction, run this command to perform feature matching between
the images `hertford_000056.jpg` and `oxford_000317.jpg`: the images `hertford_000056.jpg` and `oxford_000317.jpg`:
```bash ```bash
python match_images.py \ python3 match_images.py \
--image_1_path data/oxford5k_images/hertford_000056.jpg \ --image_1_path data/oxford5k_images/hertford_000056.jpg \
--image_2_path data/oxford5k_images/oxford_000317.jpg \ --image_2_path data/oxford5k_images/oxford_000317.jpg \
--features_1_path data/oxford5k_features/hertford_000056.delf \ --features_1_path data/oxford5k_features/hertford_000056.delf \
...@@ -84,4 +84,4 @@ By default, skimage 0.13.XX or 0.14.1 is installed if you followed the ...@@ -84,4 +84,4 @@ By default, skimage 0.13.XX or 0.14.1 is installed if you followed the
instructions. According to instructions. According to
[https://github.com/scikit-image/scikit-image/issues/3649#issuecomment-455273659] [https://github.com/scikit-image/scikit-image/issues/3649#issuecomment-455273659]
If you have scikit-image related issues, upgrading to a version above 0.14.1 If you have scikit-image related issues, upgrading to a version above 0.14.1
with `pip install -U scikit-image` should fix the issue with `pip3 install -U scikit-image` should fix the issue
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
### Tensorflow ### Tensorflow
[![TensorFlow 2.1](https://img.shields.io/badge/tensorflow-2.1-brightgreen)](https://github.com/tensorflow/tensorflow/releases/tag/v2.1.0) [![TensorFlow 2.1](https://img.shields.io/badge/tensorflow-2.1-brightgreen)](https://github.com/tensorflow/tensorflow/releases/tag/v2.1.0)
[![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/)
For detailed steps to install Tensorflow, follow the For detailed steps to install Tensorflow, follow the
[Tensorflow installation instructions](https://www.tensorflow.org/install/). A [Tensorflow installation instructions](https://www.tensorflow.org/install/). A
...@@ -10,9 +11,9 @@ typical user can install Tensorflow using one of the following commands: ...@@ -10,9 +11,9 @@ typical user can install Tensorflow using one of the following commands:
```bash ```bash
# For CPU: # For CPU:
pip install 'tensorflow' pip3 install 'tensorflow'
# For GPU: # For GPU:
pip install 'tensorflow-gpu' pip3 install 'tensorflow-gpu'
``` ```
### TF-Slim ### TF-Slim
...@@ -23,7 +24,7 @@ using previous versions which relied on tf.contrib (which is now deprecated). ...@@ -23,7 +24,7 @@ using previous versions which relied on tf.contrib (which is now deprecated).
```bash ```bash
git clone git@github.com:google-research/tf-slim.git git clone git@github.com:google-research/tf-slim.git
cd tf-slim cd tf-slim
pip install . pip3 install .
``` ```
Note that these commands assume you are cloning using SSH. If you are using Note that these commands assume you are cloning using SSH. If you are using
...@@ -51,8 +52,8 @@ PATH_TO_PROTOC=`pwd` ...@@ -51,8 +52,8 @@ PATH_TO_PROTOC=`pwd`
Install python library dependencies: Install python library dependencies:
```bash ```bash
pip install matplotlib numpy scikit-image scipy pip3 install matplotlib numpy scikit-image scipy
sudo apt-get install python-tk sudo apt-get install python3-tk
``` ```
### `tensorflow/models` ### `tensorflow/models`
...@@ -90,13 +91,13 @@ under the hood. ...@@ -90,13 +91,13 @@ under the hood.
```bash ```bash
# From tensorflow/models/research/delf/ # From tensorflow/models/research/delf/
pip install -e . # Install "delf" package. pip3 install -e . # Install "delf" package.
``` ```
At this point, running At this point, running
```bash ```bash
python -c 'import delf' python3 -c 'import delf'
``` ```
should just return without complaints. This indicates that the DELF package is should just return without complaints. This indicates that the DELF package is
...@@ -104,18 +105,11 @@ loaded successfully. ...@@ -104,18 +105,11 @@ loaded successfully.
### Troubleshooting ### Troubleshooting
#### Python version #### `pip3 install`
Installation issues may happen if multiple python versions are mixed. The Issues might be observed if using `pip3 install` with `-e` option (editable
instructions above assume python2.7 version is used; if using python3.X, be sure
to use `pip3` instead of `pip`, `python3-tk` instead of `python-tk`, and all
should work.
#### `pip install`
Issues might be observed if using `pip install` with `-e` option (editable
mode). You may try out to simply remove the `-e` from the commands above. Also, mode). You may try out to simply remove the `-e` from the commands above. Also,
depending on your machine setup, you might need to run the `sudo pip install` depending on your machine setup, you might need to run the `sudo pip3 install`
command, that is with a `sudo` at the beginning. command, that is with a `sudo` at the beginning.
#### Cloning github repositories #### Cloning github repositories
......
# DELF: DEep Local Features # DELF: DEep Local Features
[![TensorFlow 2.1](https://img.shields.io/badge/tensorflow-2.1-brightgreen)](https://github.com/tensorflow/tensorflow/releases/tag/v2.1.0) [![TensorFlow 2.1](https://img.shields.io/badge/tensorflow-2.1-brightgreen)](https://github.com/tensorflow/tensorflow/releases/tag/v2.1.0)
[![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/)
This project presents code for extracting DELF features, which were introduced This project presents code for extracting DELF features, which were introduced
with the paper with the paper
......
...@@ -87,7 +87,7 @@ Query feature extraction can be run as follows: ...@@ -87,7 +87,7 @@ Query feature extraction can be run as follows:
```bash ```bash
# From models/research/delf/delf/python/detect_to_retrieve # From models/research/delf/delf/python/detect_to_retrieve
python extract_query_features.py \ python3 extract_query_features.py \
--delf_config_path delf_gld_config.pbtxt \ --delf_config_path delf_gld_config.pbtxt \
--dataset_file_path ~/detect_to_retrieve/data/gnd_roxford5k.mat \ --dataset_file_path ~/detect_to_retrieve/data/gnd_roxford5k.mat \
--images_dir ~/detect_to_retrieve/data/oxford5k_images \ --images_dir ~/detect_to_retrieve/data/oxford5k_images \
...@@ -100,7 +100,7 @@ Index feature extraction / box detection can be run as follows: ...@@ -100,7 +100,7 @@ Index feature extraction / box detection can be run as follows:
```bash ```bash
# From models/research/delf/delf/python/detect_to_retrieve # From models/research/delf/delf/python/detect_to_retrieve
python extract_index_boxes_and_features.py \ python3 extract_index_boxes_and_features.py \
--delf_config_path delf_gld_config.pbtxt \ --delf_config_path delf_gld_config.pbtxt \
--detector_model_dir parameters/d2r_frcnn_20190411 \ --detector_model_dir parameters/d2r_frcnn_20190411 \
--detector_thresh 0.1 \ --detector_thresh 0.1 \
...@@ -125,7 +125,7 @@ Run query feature aggregation as follows: ...@@ -125,7 +125,7 @@ Run query feature aggregation as follows:
```bash ```bash
# From models/research/delf/delf/python/detect_to_retrieve # From models/research/delf/delf/python/detect_to_retrieve
python extract_aggregation.py \ python3 extract_aggregation.py \
--use_query_images True \ --use_query_images True \
--aggregation_config_path query_aggregation_config.pbtxt \ --aggregation_config_path query_aggregation_config.pbtxt \
--dataset_file_path ~/detect_to_retrieve/data/gnd_roxford5k.mat \ --dataset_file_path ~/detect_to_retrieve/data/gnd_roxford5k.mat \
...@@ -139,7 +139,7 @@ Run index feature aggregation as follows: ...@@ -139,7 +139,7 @@ Run index feature aggregation as follows:
```bash ```bash
# From models/research/delf/delf/python/detect_to_retrieve # From models/research/delf/delf/python/detect_to_retrieve
python extract_aggregation.py \ python3 extract_aggregation.py \
--aggregation_config_path index_aggregation_config.pbtxt \ --aggregation_config_path index_aggregation_config.pbtxt \
--dataset_file_path ~/detect_to_retrieve/data/gnd_roxford5k.mat \ --dataset_file_path ~/detect_to_retrieve/data/gnd_roxford5k.mat \
--features_dir ~/detect_to_retrieve/data/oxford5k_features/index_0.1 \ --features_dir ~/detect_to_retrieve/data/oxford5k_features/index_0.1 \
...@@ -156,7 +156,7 @@ To run retrieval on `roxford5k`, the following command can be used: ...@@ -156,7 +156,7 @@ To run retrieval on `roxford5k`, the following command can be used:
```bash ```bash
# From models/research/delf/delf/python/detect_to_retrieve # From models/research/delf/delf/python/detect_to_retrieve
python perform_retrieval.py \ python3 perform_retrieval.py \
--index_aggregation_config_path index_aggregation_config.pbtxt \ --index_aggregation_config_path index_aggregation_config.pbtxt \
--query_aggregation_config_path query_aggregation_config.pbtxt \ --query_aggregation_config_path query_aggregation_config.pbtxt \
--dataset_file_path ~/detect_to_retrieve/data/gnd_roxford5k.mat \ --dataset_file_path ~/detect_to_retrieve/data/gnd_roxford5k.mat \
...@@ -193,7 +193,7 @@ example command: ...@@ -193,7 +193,7 @@ example command:
```bash ```bash
# From models/research/delf/delf/python/detect_to_retrieve # From models/research/delf/delf/python/detect_to_retrieve
python perform_retrieval.py \ python3 perform_retrieval.py \
--index_aggregation_config_path index_aggregation_config.pbtxt \ --index_aggregation_config_path index_aggregation_config.pbtxt \
--query_aggregation_config_path query_aggregation_config.pbtxt \ --query_aggregation_config_path query_aggregation_config.pbtxt \
--dataset_file_path ~/detect_to_retrieve/data/gnd_roxford5k.mat \ --dataset_file_path ~/detect_to_retrieve/data/gnd_roxford5k.mat \
...@@ -215,7 +215,7 @@ K-means are not registered for GPU usage in Tensorflow. ...@@ -215,7 +215,7 @@ K-means are not registered for GPU usage in Tensorflow.
```bash ```bash
# From models/research/delf/delf/python/detect_to_retrieve # From models/research/delf/delf/python/detect_to_retrieve
python cluster_delf_features.py \ python3 cluster_delf_features.py \
--dataset_file_path ~/detect_to_retrieve/data/gnd_rparis6k.mat \ --dataset_file_path ~/detect_to_retrieve/data/gnd_rparis6k.mat \
--features_dir ~/detect_to_retrieve/data/paris6k_features/index_0.1 \ --features_dir ~/detect_to_retrieve/data/paris6k_features/index_0.1 \
--num_clusters 1024 \ --num_clusters 1024 \
......
...@@ -13,7 +13,7 @@ Assuming the data was downloaded to `/tmp/gld_tfrecord/`, running the following ...@@ -13,7 +13,7 @@ Assuming the data was downloaded to `/tmp/gld_tfrecord/`, running the following
command should start training a model: command should start training a model:
```sh ```sh
python tensorflow_models/research/delf/delf/python/training/train.py \ python3 tensorflow_models/research/delf/delf/python/training/train.py \
--train_file_pattern=/tmp/gld_tfrecord/train* \ --train_file_pattern=/tmp/gld_tfrecord/train* \
--validation_file_pattern=/tmp/gld_tfrecord/train* \ --validation_file_pattern=/tmp/gld_tfrecord/train* \
--debug --debug
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment