Skip to content

Commit

Permalink
manual tests in bash
Browse files Browse the repository at this point in the history
  • Loading branch information
tonylampada committed Oct 18, 2023
1 parent 33a50d5 commit cc2c0be
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 9 deletions.
11 changes: 5 additions & 6 deletions roboflowpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,29 @@ def upload(args):
project_name=p,
)


def main():
def _argparser():
parser = argparse.ArgumentParser(description="main description")
subparsers = parser.add_subparsers(title="subcommands")

login_parser = subparsers.add_parser("login", help="Log in to Roboflow")
login_parser.set_defaults(func=login)

download_parser = subparsers.add_parser("download", help="Download a dataset version from your workspace or Roboflow Universe.")
download_parser.add_argument("datasetUrl", help="Dataset URL (e.g., `roboflow-100/cells-uyemf/2`)")
download_parser.add_argument("-f",
choices=["coco", "yolov5pytorch", "yolov7pytorch", "my-yolov6", "darknet", "voc", "tfrecord",
"createml", "clip", "multiclass", "coco-segmentation", "yolo5-obb", "png-mask-semantic"],
"createml", "clip", "multiclass", "coco-segmentation", "yolo5-obb", "png-mask-semantic", "yolov8"],
help="Specify the format to download the version in (default: interactive prompt)")
download_parser.add_argument("-l", help="Location to download the dataset")
download_parser.set_defaults(func=download)

upload_parser = subparsers.add_parser("upload", help="Upload a dataset")
upload_parser.add_argument("folder", help="filesystem path to a folder that contains your dataset")
upload_parser.add_argument("-w", help="workspace url")
upload_parser.add_argument("-p", help="Project name")
upload_parser.add_argument("-f", choices=["voc", "yolov8", "yolov5"], help="format")
upload_parser.set_defaults(func=upload)
return parser

def main():
parser = _argparser()
args = parser.parse_args()
if hasattr(args, 'func'):
args.func(args)
Expand Down
26 changes: 26 additions & 0 deletions tests/manual/debugme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import sys
import os

thisdir = os.path.dirname(os.path.abspath(__file__))
rootdir = os.path.abspath(f"{thisdir}/../..")
os.environ["ROBOFLOW_CONFIG_DIR"] = f"{thisdir}/data/.config"
sys.path.append(rootdir)

from roboflowpy import _argparser

if __name__ == "__main__":
parser = _argparser()
args = parser.parse_args(["login"])
# args = parser.parse_args(
# [
# "upload",
# "./data/cultura-pepino-voc",
# "-w",
# "wolfodorpythontests",
# "-p",
# "cultura-pepino-upload-test-voc",
# "-f",
# "voc",
# ]
# )
args.func(args)
16 changes: 14 additions & 2 deletions tests/manual/download.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
export ROBOFLOW_CONFIG_DIR=./data/.config
python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f voc -l ./data/cultura-pepino-voc

# python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f coco -l ./data/cultura-pepino-coco
# python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f yolov5pytorch -l ./data/cultura-pepino-yolov5pytorch
# python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f yolov7pytorch -l ./data/cultura-pepino-yolov7pytorch
# python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f my-yolov6 -l ./data/cultura-pepino-my-yolov6
# python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f darknet -l ./data/cultura-pepino-darknet
# python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f voc -l ./data/cultura-pepino-voc
# python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f tfrecord -l ./data/cultura-pepino-tfrecord
# python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f createml -l ./data/cultura-pepino-createml
# python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f clip -l ./data/cultura-pepino-clip
# python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f multiclass -l ./data/cultura-pepino-multiclass
# python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f coco-segmentation -l ./data/cultura-pepino-coco-segmentation
# python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f yolo5-obb -l ./data/cultura-pepino-yolo5-obb
python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f yolov8 -l ./data/cultura-pepino-yolov8
# python ../../roboflowpy.py download motusbots/cultura-pepino/2 -f png-mask-semantic -l ./data/cultura-pepino-png-mask-semantic
4 changes: 3 additions & 1 deletion tests/manual/upload.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export ROBOFLOW_CONFIG_DIR=./data/.config
python ../../roboflowpy.py upload ./data/cultura-pepino-voc -w wolfodorpythontests-iqu7t -p cultura-pepino-upload-test -f voc
# python ../../roboflowpy.py upload ./data/cultura-pepino-voc -w wolfodorpythontests -p cultura-pepino-upload-test-voc -f voc
python ../../roboflowpy.py upload ./data/cultura-pepino-yolov8 -w wolfodorpythontests -p cultura-pepino-upload-test-yolov8 -f yolov8
# python ../../roboflowpy.py upload ./data/cultura-pepino-yolov5pytorch -w wolfodorpythontests -p cultura-pepino-upload-test-yolov5 -f yolov5
2 changes: 2 additions & 0 deletions tests/manual/useprod
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export API_URL=https://api.roboflow.com
export APP_URL=https://app.roboflow.com
2 changes: 2 additions & 0 deletions tests/manual/usestaging
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export API_URL=https://api.roboflow.one
export APP_URL=https://app.roboflow.one

0 comments on commit cc2c0be

Please sign in to comment.