Skip to content

Commit

Permalink
I think this should all work
Browse files Browse the repository at this point in the history
  • Loading branch information
thesteve0 committed Nov 7, 2024
1 parent dc1dfe5 commit bcaee2b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 24 deletions.
2 changes: 1 addition & 1 deletion make_dataset.py → 1_make_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ def start_fiftyone():
if __name__ == "__main__":
print("reading in data")
import_and_create_with_fields()
start_fiftyone()
#start_fiftyone()
print("done")
18 changes: 18 additions & 0 deletions 2_data_splitting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import fiftyone as fo
import fiftyone.zoo as foz
import fiftyone.brain as fob
from sympy.core.random import shuffle

dataset_name = "photo_album"

if __name__ == "__main__":
print("starting")
dataset = fo.load_dataset(dataset_name)
# A DatasetView is a shallow copy of the original dataset.This means,
# if your dataset is persisted, any data or schema changes to the view will be persisted to the original dataset.
# If you don't want to affect the original dataset you must make the view a clone of the original data.
shuffle_view = dataset.shuffle()
training_view = shuffle_view[0:300].clone()
training_view.save()

print("finished")
25 changes: 25 additions & 0 deletions 3_make_embeddings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import fiftyone as fo
import fiftyone.zoo as foz
import fiftyone.brain as fob

from imageio.plugins.ffmpeg import download

dataset_name = "training_data"
# model = foz.load_zoo_model("faster-rcnn-resnet50-fpn-coco-torch")
# samples.compute_embeddings(model, embeddings_field="embeddings")

if __name__ == "__main__":

training_view = fo.load_dataset("training_data")

model = foz.load_zoo_model('resnet101-imagenet-torch')
fob.compute_visualization(training_view, model=model, embeddings="sresnet101_imagenet",
brain_key="resnet101_imagenet_embed")

model2 = foz.load_zoo_model("vgg11-bn-imagenet-torch")
fob.compute_visualization(training_view, model=model2, embeddings="fvgg11_bn", brain_key="vgg11_bn_embed")

session = fo.launch_app(dataset)
session.wait()

print("done")
23 changes: 0 additions & 23 deletions make_embeddings.py

This file was deleted.

0 comments on commit bcaee2b

Please sign in to comment.