Skip to content
Closed
Changes from all commits
Commits
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
32 changes: 22 additions & 10 deletions roboflow/core/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,7 @@ def generate_version(self, settings):

def train(
self,
new_version_settings={
"preprocessing": {
"auto-orient": True,
"resize": {"width": 640, "height": 640, "format": "Stretch to"},
},
"augmentation": {},
},
new_version_settings=None,
speed=None,
checkpoint=None,
plot_in_notebook=False,
Expand Down Expand Up @@ -294,6 +288,15 @@ def train(
>>> version.train()
""" # noqa: E501 // docs

if new_version_settings is None:
new_version_settings = {
"preprocessing": {
"auto-orient": True,
"resize": {"width": 640, "height": 640, "format": "Stretch to"},
},
"augmentation": {},
}

new_version = self.generate_version(settings=new_version_settings)
new_version = self.version(new_version)
new_model = new_version.train(speed=speed, checkpoint=checkpoint, plot_in_notebook=plot_in_notebook)
Expand Down Expand Up @@ -557,13 +560,15 @@ def single_upload(
split="train",
num_retry_uploads=0,
batch_name=None,
tag_names=[],
tag_names=None,
is_prediction: bool = False,
annotation_overwrite=False,
sequence_number=None,
sequence_size=None,
**kwargs,
):
if tag_names is None:
tag_names = []
if image_path and image_id:
raise Exception("You can't pass both image_id and image_path")
if not (image_path or image_id):
Expand Down Expand Up @@ -641,7 +646,7 @@ def search(
in_dataset: Optional[str] = None,
batch: bool = False,
batch_id: Optional[str] = None,
fields: list = ["id", "created", "name", "labels"],
fields: Optional[list] = None,
):
"""
Search for images in a project.
Expand Down Expand Up @@ -672,6 +677,9 @@ def search(
""" # noqa: E501 // docs
payload: Dict[str, Union[str, int, List[str]]] = {}

if fields is None:
fields = ["id", "created", "name", "labels"]

if like_image is not None:
payload["like_image"] = like_image

Expand Down Expand Up @@ -719,7 +727,7 @@ def search_all(
in_dataset: Optional[str] = None,
batch: bool = False,
batch_id: Optional[str] = None,
fields: list = ["id", "created"],
fields: Optional[list] = None,
):
"""
Create a paginated list of search results for use in searching the images in a project.
Expand Down Expand Up @@ -752,6 +760,10 @@ def search_all(

>>> print(result)
""" # noqa: E501 // docs

if fields is None:
fields = ["id", "created"]

while True:
data = self.search(
like_image=like_image,
Expand Down