diff --git "a/data.jsonl" "b/data.jsonl" new file mode 100644--- /dev/null +++ "b/data.jsonl" @@ -0,0 +1,660 @@ +{"repo":"UXARRAY\/uxarray","instance_id":"UXARRAY__uxarray-1117","base_commit":"fe4cae1311db7fb21187b505e06018334a015c48","patch":"diff --git a\/uxarray\/grid\/connectivity.py b\/uxarray\/grid\/connectivity.py\nindex 78e936117..54bd1017e 100644\n--- a\/uxarray\/grid\/connectivity.py\n+++ b\/uxarray\/grid\/connectivity.py\n@@ -146,13 +146,14 @@ def _build_n_nodes_per_face(face_nodes, n_face, n_max_face_nodes):\n \"\"\"Constructs ``n_nodes_per_face``, which contains the number of non-fill-\n value nodes for each face in ``face_node_connectivity``\"\"\"\n \n- # padding to shape [n_face, n_max_face_nodes + 1]\n- closed = np.ones((n_face, n_max_face_nodes + 1), dtype=INT_DTYPE) * INT_FILL_VALUE\n-\n- closed[:, :-1] = face_nodes.copy()\n-\n- n_nodes_per_face = np.argmax(closed == INT_FILL_VALUE, axis=1)\n-\n+ n_face, n_max_face_nodes = face_nodes.shape\n+ n_nodes_per_face = np.empty(n_face, dtype=INT_DTYPE)\n+ for i in range(n_face):\n+ c = 0\n+ for j in range(n_max_face_nodes):\n+ if face_nodes[i, j] != INT_FILL_VALUE:\n+ c += 1\n+ n_nodes_per_face[i] = c\n return n_nodes_per_face\n \n \ndiff --git a\/uxarray\/grid\/coordinates.py b\/uxarray\/grid\/coordinates.py\nindex 45e00ba42..2d78b978a 100644\n--- a\/uxarray\/grid\/coordinates.py\n+++ b\/uxarray\/grid\/coordinates.py\n@@ -328,23 +328,25 @@ def _construct_face_centroids(node_x, node_y, node_z, face_nodes, n_nodes_per_fa\n tuple\n The x, y, and z coordinates of the centroids.\n \"\"\"\n+\n centroid_x = np.zeros((face_nodes.shape[0]), dtype=np.float64)\n centroid_y = np.zeros((face_nodes.shape[0]), dtype=np.float64)\n centroid_z = np.zeros((face_nodes.shape[0]), dtype=np.float64)\n- n_face = n_nodes_per_face.shape[0]\n-\n- for i_face in prange(n_face):\n- n_max_nodes = n_nodes_per_face[i_face]\n \n- x = np.mean(node_x[face_nodes[i_face, 0:n_max_nodes]])\n- y = np.mean(node_y[face_nodes[i_face, 0:n_max_nodes]])\n- z = np.mean(node_z[face_nodes[i_face, 0:n_max_nodes]])\n+ for face_idx in prange(face_nodes.shape[0]):\n+ n_max_nodes = n_nodes_per_face[face_idx]\n+ # Compute Cartesian Average\n+ x = np.mean(node_x[face_nodes[face_idx, 0:n_max_nodes]])\n+ y = np.mean(node_y[face_nodes[face_idx, 0:n_max_nodes]])\n+ z = np.mean(node_z[face_nodes[face_idx, 0:n_max_nodes]])\n \n+ # Normalize coordinates\n x, y, z = _normalize_xyz_scalar(x, y, z)\n+ # Store coordinates\n+ centroid_x[face_idx] = x\n+ centroid_y[face_idx] = y\n+ centroid_z[face_idx] = z\n \n- centroid_x[i_face] = x\n- centroid_y[i_face] = y\n- centroid_z[i_face] = z\n return centroid_x, centroid_y, centroid_z\n \n \n","test_patch":"","problem_statement":"Optimize Face Centroid Calculations\nIf `Grid.face_lon` does not exist, `_populate_face_centroids()`, actually `_construct_face_centroids()` in it, takes extremely long for large datasets. For instance, the benchmark\/profiling below is for a ~4GB SCREAM dataset, around 5 mins:\n\n@rajeeja FYI: I'm already working on this and have gotten optimized results, which will be good for \"cartesian\" parts of the face center calculations, but you may want to look into the `Welzl` parts as well, i.e. `_populate_face_centerpoints()`.\n\n\"Image\"\n\n","hints_text":"","created_at":1734798627000,"labels":["run-benchmark"],"category":"Performance Issue","edit_functions":["uxarray\/grid\/connectivity.py:_build_n_nodes_per_face","uxarray\/grid\/coordinates.py:_construct_face_centroids"],"added_functions":[]} +{"repo":"ultralytics\/ultralytics","instance_id":"ultralytics__ultralytics-17810","base_commit":"d8c43874ae830a36d2adeac4a44a8ce5697e972c","patch":"diff --git a\/ultralytics\/utils\/ops.py b\/ultralytics\/utils\/ops.py\nindex 25e83c61c3a..ac53546ed1b 100644\n--- a\/ultralytics\/utils\/ops.py\n+++ b\/ultralytics\/utils\/ops.py\n@@ -75,9 +75,8 @@ def segment2box(segment, width=640, height=640):\n (np.ndarray): the minimum and maximum x and y values of the segment.\n \"\"\"\n x, y = segment.T # segment xy\n- inside = (x >= 0) & (y >= 0) & (x <= width) & (y <= height)\n- x = x[inside]\n- y = y[inside]\n+ x = x.clip(0, width)\n+ y = y.clip(0, height)\n return (\n np.array([x.min(), y.min(), x.max(), y.max()], dtype=segment.dtype)\n if any(x)\n","test_patch":"","problem_statement":"Training labels not applied properly to training data\n### Search before asking\r\n\r\n- [X] I have searched the Ultralytics YOLO [issues](https:\/\/github.com\/ultralytics\/ultralytics\/issues) and found no similar bug report.\r\n\r\n\r\n### Ultralytics YOLO Component\r\n\r\nTrain\r\n\r\n### Bug\r\n\r\n# Bug\r\nLabels are not included in the generated train_batch**X**.jpg images during training of a segmentation model.\r\nCode to reproduce at bottom of section including the example training data.\r\n\r\n## Likely cause of bug\r\nI am not familiar with how the training label images are generated, however I highly suspect the issue is that if there are no points that define the polygon (label) in the image. This is caused when Yolo performs augmentation such as crop, resize, stretch, etc as it can morph the label such that all points defining the label are outside the image. This causes the mask to encompress up to the entire image but still not be included\r\n### I do not know if this affects anything other than segmentation!\r\n### This may actually affect the training data itself and not just the generated image examples, but I am not sure!\r\n\r\n## Examples\r\n- All white parts of the images are included in the label, thus if they are unlabelled the bug has occured\r\n![train_batch41](https:\/\/github.com\/user-attachments\/assets\/ff8243c4-badb-4ea9-a5c0-64b9c28fbef6)\r\n![train_batch42](https:\/\/github.com\/user-attachments\/assets\/17895e1b-a967-4c6d-8a18-39b59962893d)\r\n\r\n### Code to reproduce, instuctions in other section\r\n[GitIssues.zip](https:\/\/github.com\/user-attachments\/files\/17916419\/GitIssues.zip)\r\n\r\n\r\n### Environment\r\n\r\n```\r\nUltralytics 8.3.29 🚀 Python-3.10.12 torch-2.4.1+cu121 CUDA:0 (NVIDIA GeForce RTX 4090, 24564MiB)\r\nSetup complete ✅ (32 CPUs, 15.5 GB RAM, 23.5\/251.0 GB disk)\r\n\r\nOS Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.35\r\nEnvironment Linux\r\nPython 3.10.12\r\nInstall pip\r\nRAM 15.47 GB\r\nDisk 23.5\/251.0 GB\r\nCPU 13th Gen Intel Core(TM) i9-13900\r\nCPU count 32\r\nGPU NVIDIA GeForce RTX 4090, 24564MiB\r\nGPU count 1\r\nCUDA 12.1\r\n\r\nnumpy ✅ 2.1.2>=1.23.0\r\nmatplotlib ✅ 3.9.2>=3.3.0\r\nopencv-python ✅ 4.10.0.84>=4.6.0\r\npillow ✅ 10.4.0>=7.1.2\r\npyyaml ✅ 5.4.1>=5.3.1\r\nrequests ✅ 2.32.3>=2.23.0\r\nscipy ✅ 1.14.1>=1.4.1\r\ntorch ✅ 2.4.1>=1.8.0\r\ntorchvision ✅ 0.19.1>=0.9.0\r\ntqdm ✅ 4.66.5>=4.64.0\r\npsutil ✅ 6.0.0\r\npy-cpuinfo ✅ 9.0.0\r\npandas ✅ 2.2.3>=1.1.4\r\nseaborn ✅ 0.13.2>=0.11.0\r\nultralytics-thop ✅ 2.0.11>=2.0.0\r\nnumpy ✅ 2.1.2<2.0.0; sys_platform == \"darwin\"\r\ntorch ✅ 2.4.1!=2.4.0,>=1.8.0; sys_platform == \"win32\"\r\n```\r\n\r\n### Minimal Reproducible Example\r\n\r\n# How to reproduce\r\n1. Download & Extract provided training images, config (.yaml) and test_yolo.py file \r\n2. Edit .yaml file such that the folder path is correct\r\n3. Run test_yolo.py \r\n4. Examine the generated train_batch**X**.jpg images to see if the bug occured (You may need to train more than once)\r\n\r\n## What to look for\r\n- Any part that is white is labelled, so if any white pixels are unlabelled this bug has occured\r\n\r\n### Examples\r\n![train_batch0](https:\/\/github.com\/user-attachments\/assets\/fe7f5b3f-1b00-4004-beb1-a50b5d5413b0)\r\n- In this case the bottom left image is clearly white, but unlabelled\r\n\r\n![train_batch2](https:\/\/github.com\/user-attachments\/assets\/25cd0a90-8e46-48e8-ba99-0d15cf620719)\r\n- Top right image does has white, but it isn't labelled\r\n\r\n\r\n### Additional\r\n\r\n_No response_\r\n\r\n### Are you willing to submit a PR?\r\n\r\n- [ ] Yes I'd like to help by submitting a PR!\n","hints_text":"👋 Hello @TheOfficialOzone, thank you for bringing this to our attention 🚀! We understand that you're encountering an issue with labels not being applied correctly during the training of a segmentation model on the Ultralytics repository.\n\nFor us to assist you effectively, please ensure that you've provided a [minimum reproducible example](https:\/\/docs.ultralytics.com\/help\/minimum_reproducible_example\/) if it's not already included in your report. This will help us understand and address the issue more efficiently. It seems like you've already attached a code example and some test images, which is great!\n\n📄 In the meantime, we suggest ensuring all your dependencies are up-to-date. Upgrade to the latest `ultralytics` package, including all requirements, within a Python >=3.8 environment using PyTorch >=1.8 to see if the issue persists:\n\n```bash\npip install -U ultralytics\n```\n\nFor further tips and tricks regarding custom training, please refer to our [Tips for Best Training Results](https:\/\/docs.ultralytics.com\/guides\/model-training-tips\/).\n\nJoin our Ultralytics community for real-time support or discussions:\n\n- Head over to [Discord](https:\/\/ultralytics.com\/discord) for chat support 🎧\n- Visit [Discourse](https:\/\/community.ultralytics.com) for deeper discussions\n- Share experiences or get insightful feedback on our [Subreddit](https:\/\/reddit.com\/r\/ultralytics)\n\nFinally, an Ultralytics engineer will review the details of your issue soon and follow up with you for additional help. Thank you for your patience and cooperation!\n\n## Environments\n\nIn case you wish to shift your work to a more verified environment, you might consider:\n\n- **Notebooks** with free GPU access: \"Run<\/a> \"Open<\/a> \"Open<\/a>\n\nFor more details on different environments, please refer to the [GCP Quickstart Guide](https:\/\/docs.ultralytics.com\/yolov5\/environments\/google_cloud_quickstart_tutorial\/), [AWS Quickstart Guide](https:\/\/docs.ultralytics.com\/yolov5\/environments\/aws_quickstart_tutorial\/), or the [Docker Quickstart Guide](https:\/\/docs.ultralytics.com\/yolov5\/environments\/docker_image_quickstart_tutorial\/).\n\nWe appreciate your engagement with the Ultralytics repository and hope to resolve your issue soon! 🌟\nThis issue persists after running `pip install -U ultralytics`.\r\nThe version that was upgraded to was ultralytics 8.3.37.\n@TheOfficialOzone Thanks for reporting! I'm able to reproduce this with our dataset. I'll look into it!","created_at":1732632265000,"labels":["enhancement","segment"],"category":"Bug Report","edit_functions":["ultralytics\/utils\/ops.py:segment2box"],"added_functions":[]} +{"repo":"Chainlit\/chainlit","instance_id":"Chainlit__chainlit-1575","base_commit":"8b2d4bacfd4fa2c8af72e2d140d527d20125b07b","patch":"diff --git a\/backend\/chainlit\/config.py b\/backend\/chainlit\/config.py\nindex b90f162f07..18ee6be8db 100644\n--- a\/backend\/chainlit\/config.py\n+++ b\/backend\/chainlit\/config.py\n@@ -311,6 +311,8 @@ class CodeSettings:\n @dataclass()\n class ProjectSettings(DataClassJsonMixin):\n allow_origins: List[str] = Field(default_factory=lambda: [\"*\"])\n+ # Socket.io client transports option\n+ transports: Optional[List[str]] = None\n enable_telemetry: bool = True\n # List of environment variables to be provided by each user to use the app. If empty, no environment variables will be asked to the user.\n user_env: Optional[List[str]] = None\ndiff --git a\/backend\/chainlit\/server.py b\/backend\/chainlit\/server.py\nindex 5118f544a7..7aeabe5329 100644\n--- a\/backend\/chainlit\/server.py\n+++ b\/backend\/chainlit\/server.py\n@@ -301,7 +301,10 @@ def get_html_template():\n \n \"\"\"\n \n- js = f\"\"\"