Commit 96f9bfed authored by Rudolf Chrispens's avatar Rudolf Chrispens
Browse files

SWP picture working

parent 76b1489a
Loading
Loading
Loading
Loading
+58 −0
Original line number Diff line number Diff line
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        
        {
            "name": "Python Experimental: Current File (Integrated Terminal)",
            "type": "pythonExperimental",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        },
        {
            "name": "Python Experimental: Attach",
            "type": "pythonExperimental",
            "request": "attach",
            "port": 5678,
            "host": "localhost"
        },
        {
            "name": "Python Experimental: Django",
            "type": "pythonExperimental",
            "request": "launch",
            "program": "${workspaceFolder}/manage.py",
            "console": "integratedTerminal",
            "args": [
                "runserver",
                "--noreload",
                "--nothreading"
            ],
            "django": true
        },
        {
            "name": "Python Experimental: Flask",
            "type": "pythonExperimental",
            "request": "launch",
            "module": "flask",
            "env": {
                "FLASK_APP": "app.py"
            },
            "args": [
                "run",
                "--no-debugger",
                "--no-reload"
            ],
            "jinja": true
        },
        {
            "name": "Python Experimental: Current File (External Terminal)",
            "type": "pythonExperimental",
            "request": "launch",
            "program": "${file}",
            "console": "externalTerminal"
        }
    ]
}
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
{
    "python.pythonPath": "/usr/local/bin/python3"
}
 No newline at end of file

Demo/cnn.png

0 → 100644
+34 KiB
Loading image diff...
+24 −0
Original line number Diff line number Diff line
import pickle

def save_pickle(data, path):
    with open(path, 'wb') as handle:
        pickle.dump(data, handle)
        print('#> Script: Saved pickle', path)

def load_pickle(path):
    with open(path, 'rb') as handle:
        print('#> Script: Load pickle', path)
        return pickle.load(handle)

data = load_pickle("./swp_picture_multilabel.pickle")
data2 = load_pickle("./example.pickle")

data[0]['captions'].append({'caption': 'People sitting on a couch.', 'id': 999999, 'image_id': 999999})
data[0]['captions'].append({'caption': 'A group of people sitting on a couch.', 'id': 999999, 'image_id': 999999})
data[0]['captions'].append({'caption': 'A man holding an orange.', 'id': 999999, 'image_id': 999999})
data[0]['captions'].append({'caption': 'A group of people.', 'id': 999999, 'image_id': 999999})
data[0]['captions'].append({'caption': 'A group of people sitting on a couch.', 'id': 999999, 'image_id': 999999})

data[0]['file_name'] = '000000999999.jpg'

save_pickle(data, "./swp_picture_multilabel_done.pickle")
Loading