Skip to content

Commit 8c5956d

Browse files
author
dbickson
committed
adding more tensorboard docs
1 parent 0663853 commit 8c5956d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

RUN.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,28 @@ fastdup.create_duplicates_gallery('/path/to/similarity.csv', save_path='/path/to
295295

296296
Note: the report should be generated on the same machine since we assume that the input folder for reading the images exists under the same location.
297297

298+
Another form of visualization is using TensorBoard Projector as shown in [this notebook](https://bit.ly/3ydvtVJ).
298299

300+
The following function saves the data in a ready format for TensorBoard projector:
301+
302+
```
303+
def export_to_tensorboard_projector(work_dir:str, log_dir:str, sample_size:int = 900,
304+
sample_method:str='random', with_images=True, get_label_func=None):
305+
Export feature vector embeddings to be visualized using tensorboard projector app.
306+
work_dir: work_dir where fastdup results are stored
307+
log_dir: output dir where tensorboard will read from
308+
sample_size: how many images to view
309+
sample_method: how to sample, currently 'random' is supported
310+
with_images:bool add images to the visualization (default True)
311+
get_label_func (callable): Optional parameter to allow adding class label name to the image. This is a function the user implements that gets the full file path and returns html string with the label or any other metadata desired.
312+
:return:
313+
```
314+
315+
After storing the data you should run (in a Jupyter notebook)
316+
```
317+
%load_ext tensorboard
318+
%tensorboard --logdir=<log_dir>
319+
```
299320

300321
## Advanced topics: resuming a stored run <a name="resume"/>
301322

0 commit comments

Comments
 (0)