Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Tensorflow Hub detector support #501

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7179f68
SAHI için tensorflow_hub kütüphanesi eklendi.
kadirnar Jun 18, 2022
f79e846
reformatter
kadirnar Jun 18, 2022
3a1f3d2
hatalar düzeltildi
kadirnar Jun 19, 2022
5197fa5
To do ve check işlemleri düzenlendi.
kadirnar Jun 19, 2022
7e2d6fc
reformatter
kadirnar Jun 19, 2022
ab27f33
kurulum ve image preprocces kodları düzenlendi
kadirnar Jun 19, 2022
26f388e
CI dosyalarına tensorflow paketleri eklendi
kadirnar Jun 19, 2022
119d7a6
tensorflow sürümü düzeltildi.
kadirnar Jun 19, 2022
4e55416
sürüm düzeltildi.
kadirnar Jun 19, 2022
9b4788a
Merge branch 'main' into tfhub
kadirnar Jun 19, 2022
e7f7567
CI dosyası düzenlendi
kadirnar Jun 19, 2022
db9b319
model_path hatası düzeltildi
kadirnar Jun 19, 2022
373e032
gereksiz kütüphaneler ve Model_type düzenlendi.
kadirnar Jun 20, 2022
aac9425
model ismi düzeltildi
kadirnar Jun 20, 2022
2696758
class isimleri düzeltildi.
kadirnar Jun 20, 2022
82d359a
tensorflow için notebook oluşturuldu.
kadirnar Jun 20, 2022
3f9c324
Tensorflow kütüphanesi için GPU kodu yazılmıştır.
kadirnar Jun 20, 2022
50c19b7
Adding new class to variable Coco_classes
kadirnar Jul 18, 2022
58faf09
update automodel loading method to from_pretrained
kadirnar Jul 18, 2022
9c7acd9
Merge branch 'main' into tfhub
fcakyon Jul 18, 2022
c07222d
category_name count error fixed
kadirnar Jul 18, 2022
c03ba63
Merge branch 'tfhub' of https://github.com/kadirnar/sahi into tfhub
kadirnar Jul 18, 2022
0fb6d94
category_mapping variable moved to load model.
kadirnar Aug 5, 2022
533a80a
category_mapping variable edited
kadirnar Aug 5, 2022
d6e46fa
Merge branch 'main' into tfhub
fcakyon Aug 7, 2022
6c91202
The check_requirements function has been updated.
kadirnar Aug 8, 2022
9262bea
Merge branch 'main' into tfhub
fcakyon Aug 29, 2022
38e26a8
Merge branch 'main' into tfhub
fcakyon Aug 29, 2022
4c94739
added set_device functions
kadirnar Aug 30, 2022
f6ed750
update set_device
kadirnar Aug 30, 2022
a31a89e
Update sahi/model.py
kadirnar Sep 1, 2022
50014b1
update set_device
kadirnar Sep 3, 2022
30bc488
Merge branch 'main' into tfhub
kadirnar Sep 3, 2022
9aafc97
Update sahi/model.py
kadirnar Sep 3, 2022
22f4f80
update automatically set_device
kadirnar Sep 3, 2022
a7575f0
added self.set_device
kadirnar Sep 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions sahi/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ def set_model(self, model: Any, **kwargs):
"""
raise NotImplementedError()

def set_device(self):
"""
Sets the device for the model.
"""
raise NotImplementedError()
kadirnar marked this conversation as resolved.
Show resolved Hide resolved

def unload_model(self):
"""
Unloads the model from CPU/GPU.
Expand Down Expand Up @@ -1064,6 +1070,12 @@ def _create_object_prediction_list_from_original_predictions(


class TensorflowhubDetectionModel(DetectionModel):
def set_device(self):
import tensorflow as tf

if not (self.device):
self.device = "/gpu:0" if tf.test.is_gpu_available() else "/cpu:0"

def load_model(self):
kadirnar marked this conversation as resolved.
Show resolved Hide resolved
check_requirements(["tensorflow", "tensorflow_hub"])
import tensorflow as tf
Expand Down